问题描述
是否可以在未安装Visual Studio的计算机上设置远程调试(Msvscom.exe)?
Is there a way to set up Remote Debugging (Msvscom.exe) on a machine that does not have Visual Studio installed?
我想附加到服务在VM上运行,因此我可以调试代码中的问题。我之前已经做过,但是两台机器都已经安装了VS。
I would like to attach to the service running on the VM so I can debug an issue in the code. I've done this before but both machines have had VS installed.
Dev框正在运行Visual Studio 2010 / Windows7。VM正在运行Windows 7,而没有Visual Studio。 。
The Dev box is running Visual Studio 2010/Windows 7. The VM is running Windows 7 without Visual Studio.
推荐答案
我要复活这个,因为任何尝试这样做的人都知道这是一次彻底的痛苦。 ,并且随主机/远程系统的每种可能组合略有变化。
I'm going to resurrect this because anyone who's tried to do this knows it's a complete pain in the ass every time, and that it changes slightly with every possible combination of host/remote system you can have.
- (自2016年10月21日开始工作)
- (自2016年10月21日开始工作)
- ()
- ()
- Visual Studio 2010 remote debugger. (Working as of 21/Oct/2016)
- Visual Studio 2013 remote tools (working as of 21/Oct/2016)
- Visual Studio 2015 remote tools x86 - Direct download link
- Visual Studio 2015 remote tools x64 - Direct download link
- Visual Studio Tools (Thanks Robo Burned)
- Visual Studio 2017 Remote Tools x64 - Direct download link (Thanks Isaac Baker)
- Visual Studio 2017 Remote Tools x86 - Direct download link (Thanks Isaac Baker)
- Visual Studio 2019 Remote Tools - download link
这是我今天成功完成的设置:
This is the setup I succeeded with today:
主机(Dev)计算机:
Windows 7 Ultimate SP1 x64。运行Visual Studio 2010,.NET Framework 4。
Host (Dev) Machine:
Windows 7 Ultimate SP1 x64. Running Visual Studio 2010, .NET Framework 4.
远程计算机:
运行Windows Embedded的工业/工厂车间PC标准的32位。它看起来/感觉完全类似于Windows7。运行SP1。未安装Visual Studio。具有.NET Framework 4。
Remote Machine:
Industrial/Factory Floor PC running Windows Embedded Standard 32-bit. It looks/feels exactly like Windows 7. Running SP1. Visual Studio is not installed. Has the .NET framework 4.
网络:
两台计算机都在同一子网中。我通过RDP访问远程计算机并以这种方式运行我的应用程序。
Network:
Both machines are on the same subnet. I access the remote machine via RDP and run my application that way.
Microsoft专有的Follicle恶化实现:
记下开发人员计算机的用户名和密码。由于某种原因,您必须在远程计算机上创建完全相同的用户名和密码。因为是Microsoft。
Microsoft-Proprietary Follicle-Deterioration Implementation:
Make note of your dev machine's user name and password. For some reason you have to create exactly the same user name and password on the remote machine. Because Microsoft.
我是怎么做到的:
我从提供的链接中下载了Visual Studio 2010远程调试器。 @sJhonny。我不得不关闭该文章中的Visual Studio 2013,然后关闭到2010年。如果您想用细齿梳仔细阅读2010年文章,以找到下载内容,则该链接就在没有人找到这个旁边顶部的有用链接。如果没有,请按照上面的链接。
How I did it:
I downloaded the Visual Studio 2010 remote debugger from the link provided by @sJhonny. I had to switch off of Visual Studio 2013 in that article and over to 2010. If you care to go over the 2010 article with a fine-tooth comb to find the download, the link is right next to the "No one ever finds this helpful" link at the top. If not, just follow my link above.
将其安装在远程计算机上并运行配置向导。我为向导保留了默认值:
Install that on the remote machine and run the configuration wizard. I left the defaults for the wizard:
- 运行'Visual Studio .....已被选中
- 用户名是LocalSystem,密码为空
- 只允许本地网络上的计算机...。
在远程系统上运行远程调试器,您会看到
Run the Remote Debugger on the remote system and you'll see
在界面中。到目前为止,一切都很好。在远程计算机上运行该应用程序。在开发人员计算机上,Visual Studio中的Ctrl + Alt + P将打开附加到进程(位于工具菜单下)。我弹出一个有关我的开发机防火墙配置不正确的弹出窗口,并询问我是否要允许连接等……显然是这样。
in the interface. So far so good. Run the application on the remote machine. On the dev machine, Ctrl+Alt+P in visual studio will open "Attach to Process" (It's also under the tools menu). I got a popup about my dev machine's firewall not being configured properly and was asked if I wanted to allow the connections etc... Say yes obviously.
输入用户名@machinename'组合进入预选框...按Refresh并祈祷一点。更加努力地祈祷,您应该看到远程计算机上运行的进程的列表。选择您的过程并附加到它。
Enter the 'username@machinename' combination into the qualifier box... press Refresh and pray a little. Pray a little more a lot harder and you should see a list of the processes running on the remote machine. Select your process and attach to it.
但是我的断点不起作用!? 't ...,因为在与远程计算机上的应用程序相同的目录中使用断点会太有意义。如果您足够幸运,则会收到有关断点缓存的警告,并显示带有路径的对话框。
But my breakpoints don't work!? Of course they don't... because using the breakpoints in the same directory as the application on the remote machine would make too much sense. If you were lucky enough, you got warned about a breakpoint cache and got shown a dialog with a path.
对话框中提到了相对于远程计算机而言正确的内容。说谎它与远程计算机无关,只是它迫使您在那创建一个与当前用户同名的全新用户,因为Microsoft。为了使您的断点正常工作,请在开发机上使用路径(可在工具>选项>调试>符号:此目录中缓存符号中自定义),然后将应用程序的.pdb文件复制到该目录中。除非有自动选择的选项,否则您必须将它们复制到每个新版本中。我没有进行检查,因为我还没有停止庆祝我的远程调试成功。
The dialog mentions something about it being correct relative to the remote machine. It's lying. It has nothing to do with the remote machine except that it forced you to create a brand new user over there with the same name as your current user because Microsoft. To get your breakpoints to work, follow the path on your dev machine (customizable in Tools>Options>Debugging>Symbols: Cache symbols in this directory) and copy your application's .pdb files over to that directory. You have to copy them over with every new build, unless there's an option to do it automatically; I haven't checked because I have yet to stop celebrating my remote debugging success.
现在一切都应该正常工作。
Everything should work now.
我希望这可以帮助某人节省我多年来一直试图使它在不同机器上运行的盲目怒气。
I hope that helps someone save the hours of blinding rage I've endured trying to get this to work on different machines over the years.
这篇关于如何在没有Visual Studio的计算机上设置远程调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!