This has caught me out a few times. The first time you experience the problem you will notice that the application which was working fine before suddenly is starting to throw unusual errors when you try to run/debug it.
Windows 7 has an annoying feature where you have to specify applications to run as Administrator. You can set application to always run as Administrator if you go edit the properties of the shortcut or the exe itself and then go to Advanced and select Run as Administrator.
This is fine if you open Visual Studio using the direct shortcut to the program but what happens if you open a project file? What happens if the project file uses the Visual Studio version selector.
Yes you have guessed it, one day the application was working fine when I opened Visual studio 2010 and then selected the project from within there.
the next day I was getting unusual errors and after debugging for ages I found that it was because I had opened the project directly, which used the visual studio version program which then choose Visual Studio 2010 but it didn’t run it as Administrator.
I tried changing the properties of Visual Studio program Version Selector but it then wouldn’t open the project at all.
So my advice is when you open any projects or sln files in Visual Studio 2010 on windows 7, open Visual Studio first and then select the project.