Debug code on machine without installing Visual Studio - c#

I have one test machine that my program needs to run on that machine. It fails to run but I don't know the reason.
I want to debug the code on that machine to check the issue without installing Visual Studio 2012 on that machine. I have the source code of the program. What should I do?
Thanks.

You will need to use the remote debugging tools, go to your start menu, find your visual studio and expand it, find Visual Studio Tools and then remote debugging folder.
When you have this copy the x86 or x64 folder over to the machine you want to debug on and run the application or web page and msvsmon.exe.
Then on your machine from the debugging menu attach to process, and then target the machine that you want to run against.
Then look for the process you want to debug

You can use remote debugging and debug the remote code on your machine as you have the source code. You can also write exception logs in remote application to know what error has occurred at what place in your code. For remote debugging the see the detailed explanation about remote debugging as under from MSDN article.
How to: Enable Remote Debugging
Visual Studio provides support for remote debugging, that is, the ability to debug an .exe on another computer connected to your network. The Use remote machine property on the Debug page of the Project Designer enables remote debugging of an .exe. When this option is selected, you must specify the name of the machine on which the .exe will run. The location of the .exe on the remote machine must match the value of the Make exe path property, which is on the Compile page of the Project Designer.
In order to debug on a remote machine, the following conditions must be met:
The remote machine must have debugger components installed.
The user of the local machine needs to be in the Debugger Users group on the remote machine.
The .exe must be in a shareable directory on the remote machine.
For more information, see Remote Debugging Setup.
To enable remote debugging
Make sure that the remote machine is properly configured for remote 2. debugging. For more information, see Remote Debugging Setup.
With a project selected in Solution Explorer, on the Project menu click Properties.
Click the Debug tab.
Select the Use remote machine check box.
In the Use remote machine field, enter the name of the remote machine, using the format \domain\machinename.

I would check remote debugging. You can find information about here.

Related

Remote debugging of ASP.Net Core 2.2 + .Net framework under IIS

I have a particular setup which is giving me trouble in getting remote debugging to work.
ASP.Net Core 2.2 targeting full .NET framwork 4.7.2
Running under IIS 8.5, Out-of-Process
I am trying to remote debug in Visual Studio 2017. I can connect to the remote debugger, see the processes etc. There is no dotnet.exe running, just w3wp.exe and under that, the application X.exe
I can connect to the w3wp.exe but any breakpoints say they won't be hit as symbols are not loaded. I built/deployed with Debug and there is an X.pdb in the same location as X.exe both locally and remotely.
Debug->Windows->Modules is not much use to load symbols as all that is listed there are the standard .dlls which w3wp.exe loads. The app is an .exe, not a .dll module and so is not in the list and so I cannot load symbols manually.
I have tried connecting to X.exe directly but it just says it can't connect and to make sure the remote debugger is running (which it is, since I can connect easily to the w3wp.exe process).
I have tried coping everything (including the .exe and .pdb) to the same path on the remote (that is set in the debugging options). I have also tried running the remote debugger as the same user as the one running the local VS. Always the same result.
Any ideas appreciated.
As far as I know, we could attach the w3wp.exe to remote debug the IIS asp.net core application. Make sure you attch the right worker process.
Besides, I suggest you could try to follow below settings to set the symbols in your visual studio 2017.
I suggest you could copy your local project’s bin folder path and add it into the symbol file. locations as below:
Example: C:\Users\usernmae\source\repos\TestCore\bin\Debug\
Details about how to remote debug the application, I suggest you could refer to this article.

Remote Debugging on Remote Desktop

I'm currently developing a WPF-Program which is running on an external server.
I now have installed the Remote Debugger both on the server and on my notebook.
For my tests, I don't install this program, just to save time .. but is there a chance, to Debug the *.exe file which is copied to the server?
Thanks in advance!
Go to Debug->Attach to process in VS menu.In the opened dialog inside Connection target box find your remote server through IP or hostname. It will show the exe running on server (if you have run VS remote debugger MSVSMON.EXE running on server machine) .Click on attach button and then you can debug the exe.

visual studio 2010 remote debugging: start external program: directory does not exist

Everything works if I do "Attach To Process".
But I need to debug a problem during launch of an application, so I need to be able to either "Start project" or "Start external program" the remote exe.
When I do, I get "directory does not exist". (Presumably, It is either looking for this non-existent directory LOCALLY, or it lacks permissions.)
Details:
* .Net Framework 3.5; C# Windows Form, with button that when clicked does
Debug.WriteLine("Hello World!");
Two Windows 7 Ultimate PCs, with same username and password, administrator.
Local PC:
Visual Studio 2010 Professional. Hello World project open and built.
Tested locally: Start Debugging / hit button / see "Hello World!" in VS Output pane.
Quit local version of app.
Remote PC:
Visual "Microsoft Visual C++ 2010 SP1 Redistributable" installed (so can run a debug version of this .Net application; before installing said "The program can't start because MSVCR100.dll is missing, when hit a breakpoint.").
Visual Studio Remote Debugging Monitor running.
says "(date/time) Msvsmon started a new server named Steve#FRESHINSTALL: Waiting for new connections".
When Attach to Process, says "FreshInstall\Steve connected".
Copy from local pc's project location (in default VS 2010 projects), \bin\debug* to C:\Code\HelloWorld*
Code folder is Shared with full privileges (just in case ...)
Attach to Process works fine:
click button => "Hello World" -- in Local PC's Output pane, just like when running locally.
Now, the problem. How LAUNCH the .exe remotely, instead of Attach to Process?
On Debug pane:
Tried "Start project"
alternatively, tried "Start external program:" C:\Code\HelloWorld\HelloWorld.exe" -- on Remote PC, this is the path to .exe
Working directory: "C:\Code\HelloWorld" <-- this directory ONLY exists on Remote PC (deliberately -- to make sure we aren't executing locally)
[checkmark] Use remote machine: FRESHINSTALL.
Tried with and without "Enable the Visual Studio hosting process".
When do "Start Debugging", all variations say "The working directory does not exist: "C:\Code\HelloWorld".
Well, of course not: it is on Remote PC, not locally.
Yet everywhere I look, this is what instructions say to do.
What am I supposed to do differently, or what could be wrong?
(Obviously this simple app, I could stick with Attach To Process. But I have a MUCH more complicated multiple-dll application, which is having a problem during startup. I need to breakpoint the "real" application during its start up, not after it is already running.)
(And the real situation I have to debug, is on the other side of the world, with a slow internet link. This is a local simulation of what is going wrong there. Not practical to install visual studio on the actual remote PC, to turn it into a local debugging situation. Spent a day trying to remote debug that; after I get it working on a local network, I have to duplicate the whole process with much less control over what is going on.)
In the interests of closing this question, to indicate that it has been addressed:
See wal's first comment on my question, and follow the link he gave, which I repeat here:
Visual Studio remote upload and debugging on other computer

VS remote debug problems

I am trying attach process on other PC to debug remote. But Type of code in the "Attach to process" dialog is always Native (x86 or x64) and never Managed code (my App is 100% managed). And after attaching I can't debug managed code. Why is that happens?
Now I have to change my question. The problem was in Remote transport mode(only native code support). But now I cant start working.
I made user with my login name and password on other PC with admin rights
I have run remote debugger from that user
After i chose Brows to that PC( server name from remote debugger), debugger says:
Unable to connect to server. The requested name is valid, but no data or the requested type was found.
On the remote computer look for in the Visual Studio Remote Debugging Monitor for something like Msvsmon started a new server named 'user#servername'...
Now, on the computer running Visual Studio enter the same server name in the Qualifier text field in the Attach to Process window. Unless you're on a 'safe network', leave the Transport at Default.
You should now be able to see your application under Available Processes.

.net Remote Debugging with Visual Studio -- "Can't find path."

My setup is:
Debugging computer:
Visual Studio 2008 Professional
Domain access
Application-running computer:
MSVSMon.exe
Workgroup only
Both computers:
Windows XP pro
Same local username and password
Access to same workgroup
I log into the same local username and password on both computers (username == "debugger"), and point VS 2008 to the remote computer, "Robot," under Project Properties > Use Remote Machine, and instruct VS to debug. In short, I followed the directions here and here. A ten second hang ensues then an error:
Error while trying to run project: Unable to start program '......\prog.exe'.
The system cannot find the path specified.
A few extra notes:
I tried "run an external program" pointing to the output of the project to no avail.
I'm not trying to debug an ASP.Net application.
The project source is on the local computer.
Please let me know if you have any solutions or leads. Thanks.
Make the executable and debug symbols accessible to both computers: in a shared or shareable directory. Make the debugging computer's project "start an external program" being the shared directory from the point of view of the application-running computer.
EDIT
Also, be sure that you are careful that you run the correct build. Don't run the Debug build remotely if the debug framework isn't installed on the remote machine!

Categories

Resources