Is there any way to debug c++ dll called from C# DllImport?

后端 未结 3 614
野性不改
野性不改 2020-12-25 12:58

I wonder if there is any way to debug c++ dll called from C# PInvoke in VS 2010. I tried to attach the project into c# application but it didn\'t work - didn\'t stop at a br

3条回答
  •  长发绾君心
    2020-12-25 13:28

    When attaching, change the "Attach to" value to "Native". The process should not be running under the managed code debugger - instead of "Debug", use the "Run" command to start.

    Also, the DLL needs to be compiled with debug info for any sensible debugging to take place. Make sure you're not P/Invoking the Release build.

    The OutputDebugString() should work regardless of debugging mode, however.

提交回复
热议问题