Reputation: 7605
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'?
Upvotes: 1
Views: 2260
Reputation: 159688
Heh, I don't think there's anything special about Program Files... But there very likely is something special about your build location: it belongs to you, and not to the Users group. Assuming you're not running the service as yourself (or SYSTEM), that puts it in the uncomfortable position of trying to run a program that can't access its own code!
I just set up a separate directory tree off of root, accessible by the Users group, and build my stuff there. But you could certainly assign the necessary permissions to whatever directory you're already using.
Upvotes: 2