问题
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?
回答1:
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.
回答2:
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.
来源:https://stackoverflow.com/questions/25813221/visual-studio-2013-remote-debugging-auto-deploy