Reputation: 12842
I get the following dialog box when I try to attach VS2008 debugger to a windows service. I googled it and tried a lot, but nothing worked.
And then checked the "Project build configuration", it is set to the following mode. I changed it to Debug then tried, but :(
Upvotes: 1
Views: 1842
Reputation: 1319
The message shown by Visual Studio is somewhat inaccurate, as switching to Debug build configuration will only solve the problem with default project settings.
Someone could arbitrarily configure the Debug configuration to behave like the Release configuration and vice versa. Of course, this is not recommended. But for some reason, you happen to have such a non-debuggable Debug configuration - see also the unchecked DEBUG constant in your screen shot.
Upvotes: 0
Reputation: 3604
Seems like that service is built in Release (ie no debug info, but optimized for performance) instead of Debug, so there you go..can't attach a debugger to the process.
EDIT
Also, make sure that in the Debug configuration of the project you have the Define DEBUG constant check, and under the Advanced (C# environment, there is a button at the bottom of the Project Properties - Build Page) you have the Debug Info of the Output set to "Full".
Upvotes: 1