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.

Vinicius Gonçalves
  • 2,514
  • 1
  • 29
  • 54

1 Answers1

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.

CathalMF
  • 9,705
  • 6
  • 70
  • 106
  • The program that is calling my dll is hosted in iis, in this case, what is the process should i use? – Vinicius Gonçalves Apr 18 '16 at 13:54
  • 2
    @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. – CathalMF Apr 18 '16 at 13:54
  • 1
    @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 https://blogs.msdn.microsoft.com/johan/2007/09/12/my-web-application-times-out-when-debugging-in-iis7/ – CathalMF Apr 18 '16 at 14:03