How do you debug a dll targeting .net 3.5 without

2019-06-13 03:07发布

When I debug my dll targeting .net 3.5, I have to attach to a process and select the option to debug .net 3.5 code as opposed to 4.0+. Apparently you can't debug both do to some incompatible changes.

Problem is I don't know how to start this process from Visual Studio in a way that I can modify the code while it is running. If I use the attach to process menu option the process has to be already running and changes are not reflected until I stop the process and rebuild the dll. How do I host the process in Visual Studio to debug 3.5 code and gain the extra debugging awesomeness being able to modify code and more easily run a debug session?

I'm using VS 2015.

1条回答
贪生不怕死
2楼-- · 2019-06-13 03:44

Hei, I often got this problem. If you start another application and want to 'add' the dll to the runtime, please try the following.

Go to your (dll's) project properties -> Debug -> start external program . If you need start parameters, you can add them below.

Now when you start the debugger ( with the befor modified config ) the application starts up and the debugger is on. Now you maybe need to start something related to the dll you are debugging to 'hit' a breakpoint & you are able to modify the debugging code.

When you use 'attach to process', visual studio restrices you to modify the code. If you then want to change something you need to stop the debugger, close all related applications, recompile , start over again.

Start External Programm

查看更多
登录 后发表回答