1

I have a class library project done in visual studio 2012.

When building this project, a dll is generated.

This dll is deployed in a machine that is in the local network and is consumed by an application that I have no control (third-party).

Is there any way to debug this dll remotely with visual studio 2012?

For example: Attach the dll and await a call to them from the third-party application, then debug.

3
  • I believe it should work, but only if your DLL is built in debug mode and you have pdb from the same dll Commented Apr 18, 2016 at 13:45
  • This is my case, i have the pdb and build in debug mode. Commented Apr 18, 2016 at 13:46
  • 1
    Here is how an extensive description how I mastered remote debugging of a DLL: stackoverflow.com/questions/19512041/… Commented Apr 18, 2016 at 13:49

1 Answer 1

2

Download and install the Visual Studio remote tools on the machine that you are deploying to. https://www.microsoft.com/en-gb/download/details.aspx?id=38184

Run that program on the remote computer

Then launch you visual studio select Debug -> Attach to process -> Choose "Remote" for the transport option and enter the ipaddress or hostname for the qualifier.

All the processes should be listed for the remote machine. Choose the process which is loading your DLL. When the remote program uses your dll then your breakpoints will be hit.

If you receive any errors when attempting to attach to the remote machine your first step should be to restart visual studio. It always breaks for me and restarting visual studio fixes it.

Sign up to request clarification or add additional context in comments.

3 Comments

The program that is calling my dll is hosted in iis, in this case, what is the process should i use?
@ViniciusGonçalves Then attach to the w3wp.exe. This is the process that runs things in IIS. You might have more than one w3wp.exe. You will need to connect to the one running the application. Look in the IIS setup to determine this.
@ViniciusGonçalves Just be aware that if your attached to IIS and leave a breakpoint sitting for more than 90 seconds IIS will kill your application. To work around this you can increase the timeout blogs.msdn.microsoft.com/johan/2007/09/12/…

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.