# Monday, 28 April 2003
You would think that compiling resources for .NET using resgen would be pretty straightforward, and most of the time you'd be right.
However, if you are trying to automate your build process by running resgen through some autmatic batch process (I happened to be using Draco) there's one little problem. If your resource file (.resx) happens to contain any embedded bitmaps or icons, the resgen compiler wants to turn them into real bitmaps during the compilation process.
Apparently, in order to do this, it really draws the bitmaps, and in doing so requires that there be a current desktop context into which to draw said bitmaps. If you run as a service (or in fact build using a batch file launched as a scheduled task) there isn't any desktop context. Resgen happily returns an exit code of 0, and fails to actually compile any resources. This took me a while to figure out as it was, but what to do about it is an even thornier problem. It turns out that when you call the underlying Win32 CreateProcess function, you can tweak the STARTUPINFO struct to set the desktop to something meaningful. Unfortunately, there's no way to get at that struct from managed code.
After contemplating changing the code in Draco in some nasty way, I finally discovered that if I ran my Draco.NET service as "Local System" and checked the box that says "Allow service to interact with the desktop" that the resource compilation would succeed. However, other bits of my build process failed because while running as local system I could no longer use SSPI authentication to my CVS repository, or copy files to network shares when the build finished.
Many triles and tribulations later (and some very strange network permissions here and there) it's now working again, but it took a good 7-8 person days to resolve the issue.
YUCK
Monday, 28 April 2003 16:37:20 (Pacific Daylight Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  | 
# Thursday, 03 April 2003
I'll be speaking this weekend at the Portland Access User's Group Database Designer's conference. Should be fun. It's at the lovely Silver Falls Conference Center. With all the rain we've been having the falls should be pretty spectacular. I'll be talking about Web Services, SQLXML and MSDE as they relate to Access.
Thursday, 03 April 2003 14:54:23 (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  | 
# Wednesday, 02 April 2003
One of the more interesting features of .NET has got to be the ability to do shadow copying. Shadow copying means running an executable, but before you run it you copy all of it's files to some other location and run them from there. It's the mechanism that ASP.NET uses to deal with changes to .aspx files. When your ASP.NET files run, they're really running from somewhere else, so you can change the aspx files and they can be recompiled. It also means that you can do autoupdates of your own apps.
Wednesday, 02 April 2003 21:57:37 (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  |