x64 上的 x86 远程调试器服务

发布于 2024-07-05 12:44:17 字数 565 浏览 10 评论 0原文

是否可以在 64 位计算机上将 x86 远程调试器安装为服务? 我需要将调试器附加到会话 0 进程中的托管代码。 该进程运行 32 位,但安装的调试器服务是 64 位,并且不会附加到 32 位进程。

我尝试使用 SC 命令创建服务,并且能够启动该服务,并验证它是否在任务管理器进程中运行。 但是,当我尝试使用 Visual Studio 连接到它时,它说远程调试器监视器未启用。 当我停止 x86 服务并启动 x64 服务时,它能够找到监视器,但仍然出现错误。

这是我尝试使用远程调试器时出现的错误: 无法附加到进程。 64 位版本的 Visual Studio 远程调试监视器 (MSVSMON.EXE) 无法调试 32 位进程或 32 位转储。 请改用 32 位版本。

这是我尝试本地附加时出现的错误: 此计算机不支持附加到不同终端服务器会话中的进程。 尝试对计算机进行远程调试并在进程的会话中运行 Microsoft Visual Studio 远程调试监视器。

如果我尝试将 32 位远程调试器作为应用程序运行,则它将无法附加,因为远程调试器正在我的会话中运行,而不是在会话 0 中运行。

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.

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.

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.

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.

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

浅笑轻吟梦一曲 2024-07-12 12:44:17

安装 rdbgsetup_x64.exe 并完成配置向导后,这在我的机器上有效:

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

This works on my machine(TM) after installing rdbgsetup_x64.exe and going through the configuration wizard:

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
ゞ记忆︶ㄣ 2024-07-12 12:44:17

当尝试远程调试在 64 位 IIS 中以 32 位运行的网站时,我们遇到了同样的问题。

您还可以这样做:

  • 停止默认的调试服务
    (这将是 x64 作为安装程序
    将会很聪明并配置好
    那个要运行的)。
  • 导航到远程调试器启动
    menu文件夹并运行x86调试
    服务。 忽略有关
    的警告
    32 位/64 位。
  • 打开工具->选项窗口
    远程调试器应用程序窗口和 make
    记下“服务器
    ”中的值
    名称文本框。
  • 现在您可以附加您的视觉工作室
    通过复制“服务器名称”
    值到“限定符”文本/组合中
    “附加到进程”对话框上的框
    视觉工作室。

与此相关的是,如果您从 Windows 2008/7/Vista 连接到 2003 计算机,则 Kerberos 身份验证也存在一个低级错误,通过此处的 Connect 向 MS 报告(然后作为“外部”关闭):https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?反馈ID=508455

We had the same problem when trying to remote debug a website that is running as 32 bit inside 64 bit IIS.

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.

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

九歌凝 2024-07-12 12:44:17

1)安装x64版本。 这还会安装 x86 调试器,但不会创建快捷方式。

2) 您可以在此处找到用于 x86 进程调试的可执行文件... C:\Program Files\Microsoft Visual Studio 14.0\Common7\IDE\Remote Debugger\x86\msvsmon.exe

3) 如果需要,请将其固定到任务酒吧。

1) Install the x64 version. This also installs the x86 debugger but does not create a shortcut.

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

3) If you want to, pin it to the task bar.

新雨望断虹 2024-07-12 12:44:17

为我工作,无需安装额外的软件。 我刚刚复制了 VM 上的 C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger 文件夹,并从x86 文件夹。 我的访客和主机都是x64

Worked for me without installing additional software. I just copied the C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger folder on the VM and started the msvsmon.exe from the x86 folder. Both my guest and host are x64.

天赋异禀 2024-07-12 12:44:17

有时会出现这个错误,我只要关闭Visual Studio并再次打开,一切就OK了!

vs 的行为非常奇怪

Sometimes this error occurred, I just close visual studio and open it again, everything is OK!

Very strange behavior from vs

掩饰不了的爱 2024-07-12 12:44:17

我可以确认你想做的事情确实会起作用。 我经常使用 VS2008 远程调试器将我的 32 位 xp 操作系统连接到 x64 win2003 服务器。

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.

故事未完 2024-07-12 12:44:17

我还没有尝试过这个,但无论如何这里有一个建议:

尝试手动安装 x86 远程调试器服务。

sc create "Remote Debugger" binpath= "C:\use\short\filename\in\the\path\x86\msvsmon.exe /service msvsmon90"

两个注意事项:

  • 您需要使用短文件名
    在 msvsmon.exe 的路径中
    避免必须引用路径
    (因为整个命令需要
    引用)
  • 后面必须有一个空格
    “binpath=”(并且前面没有空格
    '=' 字符)。 谁写的
    sc 的命令行解析器
    命令应该被诅咒。

然后,您可以使用 services.msc 控制面板小程序使其以正确的凭据运行。

您可能必须停止甚至删除现有的 x64 远程调试器服务。

I haven't tried this, but here's a suggestion anyway:

Try installing the x86 remote debugger service manually.

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.

Then you can use the services.msc control panel applet to get it running with the right credentials.

You'll probably have to stop or maybe even delete the existing x64 remote debugger service.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文