Problems with Visual Studio.NET 2003
Friday, July 28th, 2006I’ve normally avoided writing programming related entries on this blog, simply because most people who read my blog really don’t care. I thought I’d post this one on the off chance google will pick it up, because I spent several hours searching for the solution to this problem to no avail.
A couple different times while working on a customer project, I ran into the following compiler error:
error CS1583: ‘C:SVNRootValidChecktrunkValidCheckUIobjDebugCSC298.tmp’ is not a valid Win32 resource file
Not the exact same error, of course, the .tmp file changed each time, but I couldn’t figure out what was causing it. I was able to determine that a few other people had enountered this error message as well, but every solution I found involved checking DLLs or rolling back your code until the problem went away.
The latest time I encountered this error was immediately after I had changed the icon for the application I am developing. That cued me off that this might be some sort of unrecognized resource error. Clearly the error indicates that there is a problem with the resource file, but previously I couldn’t track down anything wrong with the resources, and the given file is a temporary one the compiler generates as it is compiling the .resx files, so it’s tough to figure out what’s causing the problem. This time, I knew it had to be with the icon I had just changed. Sure enough, when I replaced the icon with a dummy icon, the error went away.
The next thing I actually had to do was figure out what was wrong with the icon. I’m using Axialis IconWorkshop, so I opened up the offending icon and took a look. After much trial and error, I found that the largest version of my icon in the .ico file were being compressed. When I removed this option, everything worked file. Axialis indicated that this was a “Vista” option, so I’m not sure how it was checked. Windows itself displayed the icon fine, but apparently this older version of Visual Studio didn’t know what to do with it.
Another thing to note is that I only saw the error message when the problematic icon was set as the application icon (for the whole project), not for an individual window. When I used the icon elsewhere in the app, there wasn’t a problem. This might have been because when I used it for individual windows, it was using the smaller versions of the icon, which weren’t compressed.
Hope this solution gives other developers another thing to check when they run into this error in the future.