ASP.NET 1.1 Error: System.Xml.XmlReader is inaccessible due to its protection level


imageWhile recompiling an ASP.NET 1.1 (legacy) application recently I was met with a series of errors that “System.Xml.XmlReader is inaccessible due to its protection level” (along with other System.Xml related messages). I couldn’t find a good answer to why I would be getting an error like this searching online, so I figured I’d share what I found in the hopes that I someone else having the same problems won’t have to dig as deep as I did.

imageBackground: This is a legacy ASP.NET 1.1 solution that I need to support in a Virtual Machine development environment. We lost the VM that the solution was developed on but had a copy of the source code backed up. I created a new solution in Visual 2003 and dropped all the files into the solution (including those in folders). When I tried to run the app I was met with 13 build errors regarding System.Xml inaccessibility.

imageSolution: Looking at the references I noticed that System.Xml was missing. Right-click References and click Add Reference. Find System.Xml.dll from the list, double-click it (to move it to the Selected Components) and click OK.

Even thought the .cs codebehind file had the appropriate “Using” statement, the reference to the corresponding .dll was required.

Hope it helps!

2 thoughts on “ASP.NET 1.1 Error: System.Xml.XmlReader is inaccessible due to its protection level

  1. Joe, thanks for the easter egg! Was trying to get a legacy app working today and couldn’t open the project, so just renamed the .proj files and recreated teh app. But when I added the old project files into the new project, I also got this error. Googled and found your explanation, project was back online in minutes. Thank-you for taking the time to post your findings for others –Michael

Leave a Reply