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.

Thursday, December 18, 2008

Word Mail Merge "Not Responding"

I ran into an issue doing a mail merge today that, while it falls into the user-generated DOH! category, is still worth documenting. The symptom was a totally non-responsive instance of Word when I tried to do the last step "Edit Individual Items".

I have about 140 items in the merge. I selected the "ALL" button to fixup some labels manually and save the file, but Word would never come back and I'd have to kill everything and start over.

The DOH! moment came when I finally tried selecting items 1 through 150 instead of ALL. Word came back quickly with the correct data. In hindsight it's obvious Word was reading too many records from Excel. I had applied formatting to a column (not just the cells with data), and I think that was what caused Word to read all 65,555 rows from the Excel file when I told it to merge ALL.

You can confirm this by scrolling down the items in the window that pops-up when you select a data source. You can apply a Filter (e.g. Company - not equal to - blank) at this stage to eliminate the ghost rows.

DOH!

Wednesday, December 17, 2008

Ctrl+Alt+End to reboot over Remote Desktop

To reboot the remote PC in a Remote Desktop session use Ctrl-Alt-End rather than Ctrl-Alt-Del. On XP systems select "Shutdown" and you will get a choice whether to restart or go cold

Monday, December 15, 2008

"Toner Low" on Brother HL 4040 printer

Okay, it's not a VB note, but it's worth sharing. My Brother 4040 printer was refusing to print due to "Toner Low" on multiple cartridges. There was plenty of toner in the cartridge, of course, but blocking the sensor holes with electrical tape did not reset the alarm. After some hunting found this article that describes how to reset the internal page count for the cartridge. The specific instructions for the 4040 were buried in the article, so here they are:

(1) open front door
(2) hold down Cancel button
(3) press Reprint button

The Devices Reset menu appears. Arrow up/down to find your cartridge. I reset both H and S settings for both M and C cartridges

After closing the front door a "Drum Error" appeared. Rather than hunting down the cause I manually reseated both the M and C cartridges and the error disappeared.

Thursday, December 11, 2008

Located assembly's manifest definition does not match the assembly reference

I wanted to test a fix to a DLL referenced in a Visual Studio 2.0 web application project on Framework 2.0. I created a new DLL (v2.5.6) and copied it into the BIN folder of my web app, but kept a copy of the old DLL (v2.5.1) in place under a different name. I did this in case the fix didn't work, so I could easily revert.

I was surprised that Visual Studio failed, it found the renamed version 2.5.1 and threw a "located assembly's manifest definition does not match the assembly reference" error

Even though My Project, Refernces showed the correct version number for this DLL I tried removing the reference to the DLL and recreating it pointing to v2.5.6. VS threw the same error again

Simple fix was to delete the renamed older version from the BIN directory. DOH! I assumed the new DLL assembly would have a new GUID due to the new version, but apparently not.

Posting this because the most promising reference I found by searching on the error proposed a very technical solution, and this simple fix may help someone else quickly resolve this same type of error.

Access Denied error when building DLL - unable to set permissions on XML documentation file

Trying to build a Visual Basic DLL in Visual Studio 2008 was throwing an "access denied" error every time because the XML documentation file in the OBJ\Release directory could not be overwritten.

Ran into a brick wall trying to change owner of the XML file. I can't change the permissions on my own file as Administrator, WTF? Thanks MSFT for wasting more of my time with Vista!

Finally found a clue here that all I had to do was de-select the XML documentation option for the project, on the Project settings, Compile window.

I would like to know how that XML documentation got selected in the first place, possibly some auto-setting during the upgrade from VS 2005. Mystifying because the DLL built fine after the upgrade, but a couple months later when I edit the code and try to rebuild it fails.

Monday, December 8, 2008

Changing default browser in Visual Studio 2008

The command to reset the default browser in VS2008 is obvious once found, but not the easiest to find when you need it. This article explains where to find it (right-click on ASPX file, select "browse with") but did not mention that you need an ASPX file in a website project. ASPX files in my web application project did not show the browse menu. If your upgrading web projects from VS2003 you typically will choose a web application type project rather than a website project, and you may miss this.