Introduction
Debugging a Windows service using a VS.NET macro
<o:p>
While I started writing windows services I wished Microsoft provided a way to debug with a single click as with the other project types.
I recently started reading about macros and here is a macro that can debug a windows service.
<o:p>
Running the macro
- Open Windows Service project you want to debug in VS.NET
- Open Macro Explorer. Tools -> Macros -> Macro Explorer
- Load Macro Project in Macro Explorer
- Double click on “Debug” to run the macro.
<o:p>
Troubleshooting
Here is one of errors I got while I was creating the macro:
Unmanaged debugging not supported
<o:p>
Cause and Solution<o:p>
This happens when debugger tries to attach to the Windows service process.
For some reason it thinks it is an unmanaged process and hence it cannot attach itself.
The solution for this is
Install VC++.NET which includes unmanaged debugger.
<o:p>
For details on how to do that refer to:
http://support.microsoft.com/default.aspx?scid=kb;en-us;813134
<o:p>
Hope this helps!!
Happy coding J
<o:p>
<o:p>
<o:p>
<o:p>
<o:p>
Sriram works as Senior Technical Specialist at Infosys's Microsoft Technology Center.
He has been working on ASP.NET,VB.NET,C#,ASP and SQL Server for past 7 years. He loves to churn out innovative ideas.
During his freetime,you may find him hiking, humming a song in his karaoke or listening to inspiring music. You can reach him at srirambalaji_work@yahoo.com.