开发者

Debug mode and Attach to Process... in Visual Studio 2008

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.

Debug mode and Attach to Process... in Visual Studio 2008

And then checked the "Project build configuration", it is set to the following mode. I changed it to Debug开发者_如何学Python then tried, but :(

Debug mode and Attach to Process... in Visual Studio 2008


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".


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜