steven
steven

Reputation: 1

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!

Upvotes: 0

Views: 1096

Answers (1)

Pranit Kothari
Pranit Kothari

Reputation: 9841

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.

Upvotes: 1

Related Questions