title: Debugging of native code
body: <p>I have a C# Service that is calling a C DLL that was originally written in VC6.</p>
  
  <p>There is a bug in the DLL which I am trying to inspect.</p>
  
  <p>After having a nightmare trying to get debug to work I eventually added the dll to the VS2005 solution containing the C# Service and added the necessary <code>_CRT_SECURE_NO_WARNINGS</code>.</p>
  
  <p>The debug version of the service is registered using 'installutil.exe' tool.</p>
  
  <p>I can get the debugger to break just before the line where the dll is entered via a call to <code>System.Diagnostics.Debugger.Break();</code>.</p>
  
  <p>I found some instruction on the net regarding stepping into debugging unmanaged code, and enabled the 'Enable unmanaged code debugging' check box, I've also tried turning on the Options->Debugging->Native 'Load DLL exports' and 'Enable RPC Debugging' (even though it's not COM).  I've also copied the debug dll and .pdb to the same bin directory as the service.</p>
  
  <p>However the unmanaged code is not being stepped into which is what I really need.</p>
  
  <p><strong>UPDATE</strong>: I found the Debugging Type in the DLL properties and set it to 'Mixed' as per suggestion on several sites but to no avail.</p>
  
  <p><strong>UPDATE2</strong>: My project now emits the debug dll and the pdb to the same directory as the debug service. Still unable to debug the dll.</p>