I have recently switched to Windows 7 as my development machine. One of the components of the software that I work on is a Windows service. One of the tricks I use to debug the service is to make the service registry values point to my debug build of the service. I then start the service and attach to the process using VS.NET.
However, when I try to do this on Windows 7 and try to start the 'debug' version of the service I get an error message telling me that 'access is denied'. I thought there must be something wrong with my debug build of the service. But to troubleshoot the problem I tried creating a folder under 'Program Files' named 'DebugService', copying the contents of the debug build folder to this folder and pointing the service at this location. I was then able to start the service without error.
Has anybody come across this restriction in Windows 7? Having to copy the build output to a folder in 'Program Files' is inconvenient and my service is also experiencing permissions problems opening certain files that are located in this 'Program Files' folder (the installed version of the service has no such problems).
Is there some something I can do to Windows 7 to tell it that it's okay to start a service located in a folder that is not under 'Program Files'?