Thursday, April 23, 2009

Using "Zone" as a field alias in SQL query generates getDescription error 80004005

Spent a few minutes on this one and it seemed worth noting. I was trying to run a query joining a few tables using field aliases (e.g. tbl_X.fieldY AS aliasZ) because each table has an fName field that I need to reference.

The query generated an error: IErrorInfo.GetDescription failed with E_FAIL(0x80004005)

At first I thought it as a DCOM permissions issue, since error code 80004005 can indicate an insufficient security permissions when accessing resources using COM. However, it turns out my alias tbl_Zone.fName as Zone" was the problem.

Apparently Zone is a reserved word in this context? Who knew.

Wednesday, March 11, 2009

Checkbox would not check in Firefox while sharing Z-index with other checkboxes

Just debugged a little issue with checkboxes on web forms in Visual Studio 2008 while using Firefox. I have a column of checkboxes that were cloned from a single instance (cut/paste in the text portion of the design view) then distributed vertically by manually editing the top value.

The checkboxes worked fine in IE, but in Firefox I could not get them to change state to Checked. After changing to a unique z index the checkboxes started working again. Interesting.

Wednesday, January 7, 2009

Where to find the Devenv.exe /resetskippkgs command

If you install Visual Studio 2008 Standard Edition after running the VS 2008 Professional 90 day trial you may get a package load failure when you start the Standard environment.

The error message recommends running "devenv /resetskippkgs" from the command line, but no location is specified and the path was not recognized on my PC so the command did not run

For visual studio 2008 the command is found in the C:\Windows\Microsoft.NET\Framework\v3.5 directory. Make sure you have shut down any open instances of VS before running this command. The command will open a new instance, which I closed immediately in order to save the updated settings. No more warnings about packages since then

Installing Visual Studio 2008 Standard after running the VS2008 Professional trial

I could not find anything on this so here's a post to say it was easy to install Visual Studio 2008 Standard edition after running the Visual Studio Professional trial version. So far no trouble working with my web application, windows forms, windows service, and windows DLL projects that were upgraded from VS 2005 using the 2008 Pro trial version.

I installed Standard on day 89 of the trial. When I started the IDE it defaulted to the Pro trial, so I went to Control Panel, Programs & Features (Vista), and selected uninstall on the "Microsoft Visual Studio 2008 Professional - ENU" entry.

That launched an installer looking essentially the same as the VS2008 Standard installer, but with a "maintenance mode" label. Next, selected Add/Remove, and confirmed yes to "remove all of Visual Studio 2008". The warning sounds a bit ominous, but it removes just the Pro version and after that my opened up in Standard just fine. There was a single warning about a package not loading which apparently can be resolved by running devenv with the /resetskippkgs option.

Tuesday, January 6, 2009

New setup project MSI requires .NET Framework 3.5 even though project targets other Framework

If you create a new Setup project in VS2008 for a project targeting Framework 2.0 it will prompt the user to install Framework 3.5 even if it is not needed.

To fix this right-click on the Setup project in the solution explorer, select View, Launch Conditions. Right-click on the ".Net Framework" item, select Properties Window, then select your appropriate framework version (e.g. 2.0.50727)

Next time you build the solution the MSI will require only the appropriate Framework.

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!