No native code debugging in CoreCLR console application projects in VS2015?

北城余情 提交于 2019-12-02 10:09:40

问题


I really want to jump all over CoreCLR. The new project structure, the merging of nuget into the build system, the automatic refreshing of solutions when the file system reports changes, and the targeting of multiple platforms are just some of the reasons I want to move on from the old csproj/.net 4.x stuff.

One of my primary use cases is exploring multiplatform game engine design with C#, but there's some interop involved for specific platforms (hidden away in SharpDX in my case) - debug messages that come from the unmanaged side of DirectX bubble up from native code into managed code if you "enable native code debugging" in the project's debug options. CoreCLR projects don't have that option though in the project's debug settings, which means no useful debug messages, which means debugging DirectX calls is nightmarish.

I'd appreciate some insight into what's going on in this regard.


回答1:


The tooling doesn't have support for native debugging when running from VS. However, if you attach the debugger manually to the process, select both native and CoreClr (the option is in Debug -> Attach to Process) and you'll achieve what you want.

If you are using dnx then you can pass the --debug flag when the app starts, similar to this:

dnx --debug . run <args>

and it will wait for the native debugger to be attached.

PS: Caveat: if you pass --debug you must attach a native debugger. You cannot attach only the managed one.



来源:https://stackoverflow.com/questions/31558596/no-native-code-debugging-in-coreclr-console-application-projects-in-vs2015

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!