Can remote debugging Visual Studio 2010 use breakpoint, watches and step into? - c#

Currently I debug my C# application locally and use watch, breakpoint and commands like step into and the debug inspector.
setup remote debugging with another machine as described here: http://msdn.microsoft.com/en-us/library/bt727f1t.aspx
Is it possible to see the source code of remote application and go through it step-by-step as one can do locally?

Yes, you can. Just make sure that your symbol files (your .PDB files) are deployed remotely with your application.

Yes. Attaching to a remote process is just the same as attaching to a local process.

Related

How to setup remote debugging with a different directory

I have a c# visual studio 2013 project.
I want to use remote debugging.
When setting a directory on the remote machine which is identical to the local machine (ie c:\project) it works great, but I have a special directory structure dictated by my TFS and even located on another drive which is not present on the remote machine (e:). I want to know how to define a different working directory on the remote machine from the local one.
How I got around this in Visual Studio 2015 (which is probably still relevant) is by making another build configuration for remote debugging, with the output folder set to a Windows Share on the remote machine. You can secure it with Windows Authentication, and hide the share with the 'hiddenShare$' notation.
I detail it on my blog and reference the corresponding MSDN articles here:
Remote Debugging with VS2105
I also offered a similar answer to a similar question, here:
Visual Studio 2013 remote debugging, auto deploy?
Open Configuration Manager for the solution
Add a new configuration and name it appropriately. Select the box to automatically do so for all projects.
Open the project properties of the executable project you wish to remotely debug.
Ensure that the remote debugging profile is selected.
Set the build output to the network share on the remote debugging computer.
Set the remote debugging host address and port.
Found another workaround:
Create a small virtual disk how to.
Create a batch for copying
xcopy [source] [destination] /s /e /y
Just execute batch before debugging.
It should work.

debugging asp.net web service remotely

I'm trying to attach to a Web service remotely from Visual Studio (2008). I can attach to processes on the remote machine, but when I attach to w3wp.exe, the breakpoints in my code say "The breakpoint will not currently be hit. No symbols have been loaded for this document".
Something I noticed is that after attaching, the DLL of the service doesn't appear in the list of loaded modules, but I can see other DLLs referenced in the project...
Am I attaching to the wrong process? Only one w3wp.exe instance runs on the remote machine...
UPDATE
Apparently, the remote debugger needs to be installed to allow stepping into web services, it cannot be done if the remote debugger is running from a share.
Since I couldn't make it work and I don't have access to the VS 2008 installer to properly install the debugger on the remote machine, I decided to upgrade the project to VS 2010 (of which I do have the installer)...
However, I still have to manually start the debugger and add permissions to be able to attach... Is there any way you can set additional permissions when the debugger runs as a service?
If the debug symbol resources (*.pdb) are not right there with the libraries then I would say that your solution wasn't built for Debug but rather for Release (or some other build target).
I've personally not been able to attach the debugger to a project without those symbols being loadable. As a solution I'd recommend rebuilding the project for Debug and then deploying it to the suspect environment that needs your debugger.

Visual Studio 2013 remote debugging, auto deploy?

When I tried remote debugging with Windows Store applications (Metro applications), it was very easy. In the Start drop down I could choose one of the remote computer. Then VS built the project and automatically deployed the executable to the remote computer and ran it. It felt as if it were local debugging.
Now that I want to try remote debugging with an Windows application (simple C# Windows Forms), it was not that easy. I read the following page: http://msdn.microsoft.com/en-us/library/vstudio/8x6by8d2(v=vs.110).aspx
Does this mean I have to copy the built exe to the remote computer manually every single time when I build the project? Is there any way to make it work easily just like the Windows Store apps? Possibly a third-party extension or something?
I recently set this up for a work project, and encountered your post after experiencing similar issues. I detailed my solution on my blog.
Remote Debugging with VS2015
I changed the output folder to be a network share that my debugging account has access to, and the project build just creates output at that location, making it available to the debugger. I simply press the play (Debug) button on my toolbar with the 'Remote Debug' profile selected.
Open Configuration Manager for the solution
Add a new configuration and name it appropriately. Select the box to automatically do so for all projects.
Open the project properties of the executable project you wish to remotely debug.
Ensure that the remote debugging profile is selected.
Set the build output to the network share on the remote debugging computer.
Set the remote debugging host address and port.
Does this mean I have to copy the built exe to the remote computer
manually every single time when I build the project?
Yes.
Is there any way to make it work easily just like the Windows Store
apps?
You can create a post-build event in which you can do practically everything. In this case you can set up a xcopy/robocopy command which would copy the stuff to a network location.
Possibly a third-party extension or something?
Don't think so.

Remote Debugging Error

I've been refactoring some code which was previously working.
Now when debugging I get to a break point in the refactored code and when I step into the Property in question I get a message saying that Windows firewall is currently blocking remote debugging.
It doesn't make sense because the application is a console application being debugged through visual studio on my local machine. I am using VS2010 and .net 4.0.
Does anyone know why vs might be trying to remote debug?
what does your code do? does it access any external files and or databases?
It could also be an administratrion issue, try rightclicking VS and run as admin first off and see if that fixes the issue.
secondly trace your code and see if there is any links to externals, and thirdly go to windows firewall and change the settings to allow access to Visual studios~ and or databases/.net instances.

Visual Studio 2010 C# Run/Debug on Remote Machine

Please excuse my ignorance, I am mainly a Java developer and a bit unfamiliar with Visual Studio and the details of some of the debugging process.
I am creating an application (WPF and Console) in C# that is being developed on my workstation but I need to run/debug the application on another remote machine. Is there a way that I can just hit "Debug" from Visual Studio 2010 and have it emulate a run from the target machine? I need to do this because of local file directory access on the remote machine.
I have looked into remote debugging, but I think I am on the wrong track, as remote debugging just seems to use another machine to run the debugger, not the process itself.
Any information is greatly appreciated!
You will simply attach to process of the running application, for detailed explanation you should take a look at article
Remote Debugging with Visual Studio 2010
you cannot, but you can remote debug and attach to the app running on the remote machine, you will need the remote debugging tools installed on the remote machine
running (F5) on a remote machine, directly from within VS is possible in Dev11, however

Categories