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!!


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:

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world 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:

    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.


Leave a Reply

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