views:

30

answers:

1

I've been using Visual Studio 2005 for a few years and I've come across a problem which I'm wondering whether its me being stupid. I'm using Windows Vista and I can't debug a project with an assembly name containg the word "update" without running Visual Studio in administrator mode.

For example, I created a new windows forms application project leaving the default windowapplication1 assembly name and pressed F5 to debug and sure enough the project ran. I then amended the assembly name to UpdateManager and pressed F5 again. This time it wouldn't run and says its requires elevated permissions. Changing the assembly name to UpdatManager (no 'e') and it runs again?

Is this my setup or behaviour in built into Visual Studio?

+4  A: 

Awesome problem. You are using an old version of VS, one that doesn't automatically embed a manifest in the EXE to signal Vista that your program is aware of Vista UAC policies. That makes it treat your program like a legacy program, it automatically redirects file and registry access to safe locations.

That works pretty well for old programs, except the ones that are intended to update, patch or install programs. There is no easy way for Vista to see that a program is an installer. Other than, you guessed it, the name of the program.

Start by installing the Vista specific service pack for VS2005. You probably also need to fix what your program is doing and make it UAC compatible.

Hans Passant
Unfortunately, I already have the service pack installed. Based on your comments I now tried including the words patch and install in my assembly name and these too create the same issue. So it seems like its hard coded even if the app does nothing other than show a window with a close button on it. Is there a list of key words we can't use?
Carl
Yes, "setup" is another. I don't know of an authoritative list. I don't have VS2005 anymore, check if you see "Application Manifest File" in the Project + Add New Item dialog.
Hans Passant
Nope, unfortunately, no such item is available. No worries, the main thing is that I know what to avoid and importantly I can (at least for time being) stop swearing at my laptop.
Carl