While 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.
Background: 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 Studio.net 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.
Solution: 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!