This post describes how to resolve a kind of cryptic and oddly misdescriptive error message about Parser Error on your ASP.NET application or (an On-Premises) SharePoint site. I ran into this after deploying wsp-packages to a SharePoint farm, but you can apparently get this on ASP.NET MVC sites, too.
The error doesn’t actually tell you what’s wrong, so figuring it out took a while. Hopefully it’ll help you, though!
Symptoms: Parser Error from a random-looking location
Once you navigate to your web- or SharePoint site, you only get an error like this:
Server Error in ‘/’ Application.
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Index was outside the bounds of the array.
The next few rows (the actual source of the error) seem to vary wildly. The exact source depends on what went wrong in the parsing or latest deployments. In any case, they’re usually something like this:
Parser Error Line 3: <WebControls:XmlUrlDataSource runat="server" AuthType="None" HttpMethod="GET"> Line 4: <DataFileParameters> Line 5: <WebPartPages:DataFormParameter Name="RequestUrl" ParameterKey="RequestUrl" PropertyName="ParameterValues"/> Line 6: </DataFileParameters> Line 7: </WebControls:XmlUrlDataSource>
Okay, that doesn’t tell us that much! So how to get rid of it?
Most likely a wsp deploy or something else has resulted in a malformed web.config file. Redeploying did not fix this for me (it could’ve), nor did iisreset, but recycling the application pool in question did. Surprisingly.
So, there you go! Recycle the application pool, and if that does not help, go through your web.config files and see if you can figure if something’s wrong in them.
Latest posts by Antti K. Koskela (see all)
- How to fix an Office Group with no Owners - November 14, 2018
- Help! My “Content and Structure” page in SharePoint Online is gone! - November 7, 2018
- Thanks for coming to my session at SPS New England 10/20 ! - October 20, 2018
- Speaking at SPS New England on 10/20! - October 17, 2018