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!
Related
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.
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.
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.
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.
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
I emulate Windows 8 on a VM using Parallels. I store all of my developer projects on my Mac's partition for simplicity and coherence.
When I try to build an app (Visual Studio 2012) running off this network share, I get the following compile-time error:
Error 1 Error : DEP0700 : Registration of the app failed. Rejecting a request to register from file:///Z:/Users/MY_USER_NAME/Sites/App1/App1/bin/Debug/AppX/AppxManifest.xml because the files are on a network share. Copy the files to the local computer before registering the package. (0x80073cf9) App1
Does anyone know how to solve this issue? I need to tell Visual Studio 2012 that my network share is a trusted device, or at least dupe it into thinking the project is in a local drive. Is there anyway to create symbolic links in Windows?
In Visual Studio 2010, I solved this issue as outlined on this website: http://www.sehajpal.com/index.php/2010/10/how-to-solve-loadfromremotesources-error-in-vs-2010/
Thanks for the help!
This post by Gearard Boland solves this issue. Hopefully this comes in handy for anyone else developing over a network share:
Yes, it's by design that you cannot run a Metro app from a network drive and deployment from Visual Studio essentially registers the app with the system without actually packaging and installing it (so it doesn't get put into the normal install location, which is local).
You can still work with sources on a network drive, but you'll have to override the deployment location, which by default is under the project's root directory (e.g. bin\). You have several options:
You can switch from local debugging to remote debugging and set the machine name as 'localhost'. This will do a remote deployment on your local machine (thus not using the project's directory). You don't need to install the Remote Debugger tools, nor start msvsmon for this to work on localhost.
You can override the project's output directory. Right-click on the project and change the output directory to something like: $(Temp)\$(MSBuildProjectName)\bin\$(Configuration), where Temp is an environment variable pointing to your Temp directory.
If you still want normal output to live next to the sources, e.g. when you build the appx package, etc., you can override only the layout directory instead of the entire output path. For this you'll need to modify your project file directly (e.g. *.jsproj, *.csproj, ...) to add the new value:
<PropertyGroup>
<LayoutDir>C:\WorkingFolder\$(MSBuildProjectName)\$(Configuration)</LayoutDir>
</PropertyGroup>
Hope that helps.