SharePoint Designer “Error Reading File” – Bulk Blank Lines Fix

Getting “Error Reading File” when trying to open a page in SharePoint Designer? Well, it’s a bug! SharePoint designer inserts Blank lines in the aspx file when you edit!!

Fix:

Open the page as text in SPD (or any other Text editor), Remove Blank Lines (Careful! Don’t delete the code. Delete only blank lines). You can select few blank rows, and use Find & Replace!

Error Reading File

Here is the screenshot:

sharepoint designer inserting blank lines

Find the blank lines SharePoint designer adds, Remove Empty rows from the file.

sharepoint designer adding blank lines

There is a utility in codeplex: https://sharepointfilerepair.codeplex.com/

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

One thought on “SharePoint Designer “Error Reading File” – Bulk Blank Lines Fix

  • A detailed explanation of the cause of the issue can be found here:
    https://strangecodestuff.blogspot.com/2015/02/solved-sharepoint-designer-inserting.html

    Basically – SharePoint Designer is inserting blank lines. This behavior occurs around lines of literal-text within tag-blocks. In Designer every “SharePoint:ScriptBlock” and “SharePoint:StyleBlock” tag will experience this issue.

    The solution is to decorate the literal-text with the HTML Script (or Style) tags. (More often than not these opening and closing tags are missing) It is crucial that the opening HTML tag is on the same line as the “SharePoint:…block” tag. If you put it on it’s own line the problem will persist. The above text changes are necessary for every “SharePoint:…block” tag on the page.

    Now the issue is fixed. Save as many times as you want – no more blank lines are inserted.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *