visual-studio x64 上的 x86 远程调试器服务
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/76939/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
x86 Remote Debugger Service on x64
提问by NotDan
Is it possible to install the x86 Remote Debugger as a Service on a 64bit machine? I need to attach a debugger to managed code in a Session 0 process. The process runs 32bit but the debugger service that gets installed is 64bit and wont attach to the 32bit process.
是否可以在 64 位机器上安装 x86 远程调试器即服务?我需要将调试器附加到会话 0 进程中的托管代码。该进程运行 32 位,但安装的调试器服务是 64 位并且不会附加到 32 位进程。
I tried creating the Service using the SC command, and was able to get the service to start, and verified that it was running in Task manager processes. However, when I tried to connect to it with visual studio, it said that the remote debugger monitor wasn't enabled. When I stopped the x86 service, and started the x64 service and it was able to find the monitor, but still got an error.
我尝试使用 SC 命令创建服务,并且能够启动该服务,并验证它是否在任务管理器进程中运行。但是,当我尝试使用 Visual Studio 连接到它时,它说未启用远程调试器监视器。当我停止 x86 服务,并启动 x64 服务时,它能够找到监视器,但仍然出现错误。
Here is the error when I try to use the remote debugger: Unable to attach to the process. The 64-bit version of the Visual Studio Remote Debugging Monitor (MSVSMON.EXE) cannot debug 32-bit processes or 32-bit dumps. Please use the 32-bit version instead.
这是我尝试使用远程调试器时的错误:无法附加到进程。64 位版本的 Visual Studio 远程调试监视器 (MSVSMON.EXE) 无法调试 32 位进程或 32 位转储。请改用 32 位版本。
Here is the error when I try to attach locally: Attaching to a process in a different terminal server session is not supported on this computer. Try remote debugging to the machine and running the Microsoft Visual Studio Remote Debugging Monitor in the process's session.
这是我尝试在本地附加时的错误:此计算机不支持附加到不同终端服务器会话中的进程。尝试对机器进行远程调试并在进程会话中运行 Microsoft Visual Studio 远程调试监视器。
If I try to run the 32bit remote debugger as an application, it wont work attach b/c the Remote Debugger is running in my session and not in session 0.
如果我尝试将 32 位远程调试器作为应用程序运行,它不会在附加 b/c 远程调试器在我的会话中运行而不是在会话 0 中运行。
回答by
This works on my machine(TM) after installing rdbgsetup_x64.exe and going through the configuration wizard:
在安装 rdbgsetup_x64.exe 并通过配置向导后,这适用于我的机器(TM):
sc stop msvsmon90
sc config msvsmon90 binPath= "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86\msvsmon.exe /service msvsmon90"
sc start msvsmon90
回答by Andras Zoltan
We had the same problem when trying to remote debug a website that is running as 32 bit inside 64 bit IIS.
在尝试远程调试在 64 位 IIS 中以 32 位运行的网站时,我们遇到了同样的问题。
You can also do this:
你也可以这样做:
- Stop the default debugging service (which will be x64 as the installer will have been clever and configured that one to run).
- Navigate to the Remote Debugger start
menu folder and run the x86 debugging
service. Ignore the warning about
32bit/64bit. - Open the Tools->Options window of the
remote debugger app window and make
note of the value in the 'Server
Name' text box. - Now you can attach your visual studio
to it by copying the 'Server Name'
value into the 'Qualifier' text/combo box on the Attach To Process dialog
of Visual Studio.
- 停止默认调试服务(它将是 x64,因为安装程序很聪明并配置了该服务以运行)。
- 导航到远程调试器开始菜单文件夹并运行 x86 调试服务。忽略有关
32 位/64 位的警告。 - 打开远程调试器应用程序窗口的工具-> 选项窗口,并
记下“服务器
名称”文本框中的值。 - 现在,您可以通过将“服务器名称”
值复制到
Visual Studio的“附加到进程”对话框上的“限定符”文本/组合框中来将您的 Visual Studio附加到它。
On a related note, there is also a low-level bug with Kerberos authentication if you are attaching from Windows 2008/7/Vista to a 2003 machine, reported to MS (and then closed as 'external') via Connect here: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=508455
在相关说明中,如果您从 Windows 2008/7/Vista 连接到 2003 机器,Kerberos 身份验证也存在一个低级错误,并通过此处的连接报告给 MS(然后作为“外部”关闭):https: //connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=508455
回答by Michael Burr
I haven't tried this, but here's a suggestion anyway:
我还没有尝试过这个,但无论如何这里有一个建议:
Try installing the x86 remote debugger service manually.
尝试手动安装 x86 远程调试器服务。
sc create "Remote Debugger" binpath= "C:\use\short\filename\in\the\path\x86\msvsmon.exe /service msvsmon90"
Two notes:
两个注意事项:
- You'll need to use short filenames in the path to msvsmon.exe to prevent having to quote the path (since the whole command needs to be quoted)
- there must be a space after the "binpath=" (and no space before the '=' character). Whoever wrote the command line parser for the sc command should be cursed.
- 您需要在 msvsmon.exe 的路径中使用短文件名,以防止必须引用路径(因为需要引用整个命令)
- 在“binpath=”之后必须有一个空格(并且在“=”字符之前没有空格)。为 sc 命令编写命令行解析器的人应该受到诅咒。
Then you can use the services.msc control panel applet to get it running with the right credentials.
然后,您可以使用 services.msc 控制面板小程序让它以正确的凭据运行。
You'll probably have to stop or maybe even delete the existing x64 remote debugger service.
您可能不得不停止甚至删除现有的 x64 远程调试器服务。
回答by Michael Burr
I can confirm that what you want to do will indeed work. I often connect my 32 bit xp worstation to a x64 win2003 server with VS2008 remote debugger.
我可以确认你想做的事情确实会奏效。我经常使用 VS2008 远程调试器将我的 32 位 xp 优化连接到 x64 win2003 服务器。
回答by Mike Grimm
1) Install the x64 version. This also installs the x86 debugger but does not create a shortcut.
1) 安装 x64 版本。这也会安装 x86 调试器,但不会创建快捷方式。
2) You can find the executable for x86 process debugging here... C:\Program Files\Microsoft Visual Studio 14.0\Common7\IDE\Remote Debugger\x86\msvsmon.exe
2) 您可以在此处找到 x86 进程调试的可执行文件... C:\Program Files\Microsoft Visual Studio 14.0\Common7\IDE\Remote Debugger\x86\msvsmon.exe
3) If you want to, pin it to the task bar.
3) 如果需要,请将其固定到任务栏。
回答by SeyedPooya Soofbaf
Sometimes this error occurred, I just close visual studio and open it again, everything is OK!
有时会出现这个错误,我只是关闭visual studio并再次打开它,一切正常!
Very strange behavior from vs
来自 vs 的非常奇怪的行为
回答by Mukus
I ran into this issue today (64 bit OS and VS 2019). I changed Configuration to use x64 for the project, IISExpress to use 64 bit and Platform target to be x64. It still used the 32 bit debugger and complained. Finally, when I enabled Script Debugging it started using the 64 bit debugger. So I would say the combination of all did the trick.
我今天遇到了这个问题(64 位操作系统和 VS 2019)。我将配置更改为对项目使用 x64,将 IISExpress 更改为使用 64 位,将平台目标更改为 x64。它仍然使用 32 位调试器并抱怨。最后,当我启用脚本调试时,它开始使用 64 位调试器。所以我会说所有的组合都成功了。
回答by GreatDane
Worked for me without installing additional software. I just copied the C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debuggerfolder on the VM and started the msvsmon.exefrom the x86folder. Both my guest and host are x64.
对我来说有效而无需安装其他软件。我只是复制了C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Remote DebuggerVM 上的文件夹并msvsmon.exe从该x86文件夹启动。我的客人和主人都是x64。

