Tuesday, December 23, 2008

Visual Studio 2008 unable to build due to corrupted XML documentation file in referenced DLL

Just resolved a vexing problem that does not seem to be described elsewhere. I have a Visual Basic application which references a DLL built by another VB project. A couple months ago the DLL generated an XML documentation file during one of the first build attempts on Visual Studio 2008. I only wanted to verify I could build so I didn't notice or care about the XML file.

When I later tried to build again the XML file could not be overwritten. I could not delete or rename the file as Administrator or any other user. I finally de-selected the XML documentation checkbox in the Project in order to generate new builds of the DLL

Today I was blocked from building a project that references that DLL. Each time I tried it would fail while trying to copy the XML documentation file.

I finally booted to safe mode and let the OS do a low-level disk scan (CHKDISK?). The system found and removed the corrupted XML document file.

I guess I should have tried looking at the disk earlier, I've never had a situation where even Administrator could not alter or delete a file (other than malware).

Can not recall how the XML file could have been corrupted, but I'd guess it was an aborted build. I found threads that mentioned the XML file gets renamed during the build process, and can get "sticky" if you abort a build, so maybe this was a manifestation of that.

Bottom line is if you ever get an error saying something like "access denied" when trying to copy, rename, overwrite, or change settings on the XML documentation file consider running CHKDISK or the like before dynamiting your computer.

No comments: