Silverlight Student
Silverlight Student

Reputation: 4118

Visual studio Attaching debugger to windows service - never hits the break points

I attach VS 2010 to service process; after that I put breakpoint in several methods but they never seem to be hit. Any idea or tips?

Note: The services process installed is a release build. Do I have to have a debug build installed for this?

Upvotes: 0

Views: 882

Answers (1)

Mrchief
Mrchief

Reputation: 76218

You need to have a debug build for this.

In release mode, the debug info is discarded and code is optimized, so there is no way to link to original source code.

In debug mode, debugging and project state information is retained so the debugger canlink to the source code. It also emits DebuggableAttribute that tells JIT compiler that the assembly has debug info.

Helpful link: http://msdn.microsoft.com/en-us/library/ms241903.aspx

Upvotes: 1

Related Questions