简体   繁体   中英

how to debug .net assembly when it's being used by other process

I have 2 projects A and B written in C# in VS. A is treated as Host applocation, B is a dll. A will load B at runtime by Assembly.LoadFrom and Call B's method. My question is how can I debug B when A Is executing B's dll. I have source code of both projects. but when I Attach B to process A. VS told me B.dll is being used by another process which is A. So I can't set breakpoint of B's code because B's symbol is not loaded. How can I debug B when B is being used by A? thanks!

First start the executable project. Then attach your dll project to exe project using Attach to Process option.

In Visual Studio, you can do this by,

Click on Debug menu --> Chose Attach to process option.

You will see list of all running process, choose appropriate one, and you can debug your dll code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM