Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remote Debugging .NET code Visual Studio 2010

I've been searching my hat off without any result, so a question for all of you guys:

I have a computer on domain A. On there I have a virtual machine running on domain B.

I've got visual studio installed on my computer but not on the vm => hence I want to debug a program running on the vm (domain B) which I've written in .NET with my visual studio installed on the pc (domain A).

When starting the vsmon program on the vm you have 2 options (windows auth. & no auth - native only).

When selecting no authentication, native only I get to see the processes in my visual studio and I can attach, but breakpoints are not being hit (because the PDB file does not contain native symbols, since it's written in .NET?)

When selecting windows authentication I can't connect and i get the error "logon failure"...

Any ideas / suggestions on this?

(btw, my firewall on the VM is turned off)

like image 801
Nathan Avatar asked May 05 '11 10:05

Nathan


People also ask

How do I debug a remote code in Visual Studio?

Set a breakpoint on the line you want to inspect in the debugger. The declaration of the PORT variable is an excellent place to start. Next, go to the Run and Debug menu in the sidebar and select Run script: start. This will execute the application in the remote environment and attach the Node debugger.

How do I debug a .NET application in Visual Studio?

Press F5 to run the program in Debug mode. Another way to start debugging is by choosing Debug > Start Debugging from the menu. Enter a string in the console window when the program prompts for a name, and then press Enter . Program execution stops when it reaches the breakpoint and before the Console.

How do I debug .NET code?

To debug . NET and ASP.NET Core source code in Visual Studio: In Tools -> Options -> Debugging -> General, un-check Enable Just My Code. Verify Enable Source Link support is checked.

Can I debug C# in Visual Studio Code?

To start debugging, select F5, or choose the Debug Target button in the Standard toolbar, or choose the Start Debugging button in the Debug toolbar, or choose Debug > Start Debugging from the menu bar. The app starts and the debugger runs to the line of code where you set the breakpoint.


1 Answers

You need to use remote debugging with windows authentication, because you want to debug a .NET application.
As to your authentication problem, please try this solution/workaround.

The main info in this link is the following:

  1. On both machines, create a local account with the same name and password: net user username password /add
  2. On the remote machine, add that account to the local administrators group. net localgroup administrators remotecomputername\username /add
  3. On the remote machine, either login with the new account or run msvsmon under it: runas /user:remotecomputername\username "<full path>\msvsmon.exe"
  4. On the local machine, either login with the new account or run VS under it: runas /user:localcomputername\username "<full path>\devenv.exe"
like image 113
Daniel Hilgarth Avatar answered Oct 23 '22 16:10

Daniel Hilgarth