Occasionally I've been caught out where Visual Studio won't seem to let me step into a native method that I've Pinvoked from a managed language. I thought it might make a decent blog topic as the answer isn't exactly what it seems. Often your first reaction is to assume that either Visual Studio doesn't support this, or if you know its possible you may be left pondering why it is currently not working.
Fortunately it is often simply that by default when debugging a C# project, Visual Studio only attached a managed debugger meaning it cannot debug native code. To enable mixed debugging, you simply have to enable native code debugging.
To achieve this right click on your C# project in the Solution Explorer and select Debug from the side menu. Right at the bottom you should see a sub-heading entitled Enable Debuggers.
Simply tick Enable native code debugging, re-run the debugger and hopefully stepping into native methods should work fine again. Also any valid breakpoints in native code should fire too.
Tuesday, 12 August 2014
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment