Visual Studio (VS2008)、Windows 窗体应用程序中的远程调试
我正在尝试远程调试 Windows 窗体应用程序 (C#),但总是收到此错误:
无法连接到 Microsoft Visual Studio 远程调试监视器 名为“XXX. Visual Studio 遥控器 目标计算机上的调试器无法 连接回这台计算机。 认证失败。 请参阅帮助 寻求帮助。
我尝试根据 MSDN 指南进行配置,但无法使其工作。
我的设置:
- 开发计算机 - XP (x86) 已连接到域。
- 测试计算机 - Vista (x86) 不 连接到一个域。
- 我之间有网络连接 机器。
- 我在测试中创建了一个本地用户 计算机 (user1) 与我的域名 我运行 Visual Studio 的用户 (mydomain\user1)。 设置相同的密码。
在测试计算机上,我运行“msvsmon.exe”作为应用程序(而不是服务),我使用“runas”命令运行它我创建的用户。 (用户1):
runas /u:user1 msvsmon.exe
有人可以帮助我吗?
谢谢。
I'm trying to Remote Debugging a Windows Forms Application (C#), but i'm always getting this error:
Unable to connect to the Microsoft Visual Studio Remote Debugging Monitor
named 'XXX. The Visual Studio Remote
Debugger on the target computer cannot
connect back to this computer.
Authentication failed. Please see Help
for assistance.
I tried to config according to the MSDN guides but i was not able to make it work.
My setup:
- Development Computer - XP (x86) that
is connected to a domain. - Test Computer - Vista (x86) that is NOT
connected to a domain. - I have network connection between
the machines. - I created a local user in the Test
computer (user1) with the name of my domain
user that I run the Visual Studio (mydomain\user1). setup the same password. On The Test Computer i'm running "msvsmon.exe" as application (not as services), i'm running it using "runas" command with the user that i have created. (user1):
runas /u:user1 msvsmon.exe
Can Someone help me please?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我遇到的问题是我有 2 个用户:
这是不正确的(根据 Gregg Miskely 的说法)我需要在我的开发计算机中定义一个本地用户,例如:
使用相同的密码并运行 VS2008 和调试监视器该用户:
The problem that I had is that I had 2 users:
that is not correct (according to Gregg Miskely) i needed to define a local user in my development computer, for example:
with the same password and run the VS2008 and the Debugging Monitor with this user:
这就是它对我的工作方式:
远程计算机:Microsoft Virtual PC,“IHS\RDM”附加到我的公司域,以 jdoe 管理员帐户登录。
本地计算机:附加到本地域,以 jdoe、管理员帐户登录。
1) 远程计算机:安装rdbgsetup.exe(来自 Visual Studio 2005\Disk 2\Remote Debugger\x86)
2) 远程计算机:RUNAS /user MYDOMAIN\jdoe /netonly msvsmon
3) 远程计算机:msvsmon->Tools->权限添加用户“MYDOMAIN\jdoe”(我每次重新启动时都必须执行此操作)
4)本地计算机:运行msvsmon。
5)本地计算机,msvsmon->工具->权限,添加对象类型:“计算机”,“IHS\RDM”
6)本地计算机,vs2005->调试->附加到进程。 传输:默认,限定符:jdoe@RDM
7) 刷新,瞧; 进程列表!
This is how it worked for me:
Remote computer: Microsoft Virtual PC, "IHS\RDM" attached to my corporate domain, logged in as jdoe, administrator account.
Local computer: Attached to local domain, logged in as jdoe, administrator account.
1) remote computer: install rdbgsetup.exe (from Visual Studio 2005\Disk 2\Remote Debugger\x86)
2) Remote computer: RUNAS /user MYDOMAIN\jdoe /netonly msvsmon
3) Remote computer: msvsmon->Tools->permissions add user "MYDOMAIN\jdoe" (I have to do this every time I re-start)
4) local computer: run msvsmon.
5) local computer, msvsmon->Tools->permissions, add object types: "computers", "IHS\RDM"
6) local computer, vs2005->debug->attach to process. Transport: Default, Qualifier: jdoe@RDM
7) Refresh, and voila; a process list!
Gregg Miskely 有一个
如果这对阅读 Gregg 的博客文章没有帮助,那么向他发送邮件可能会有所帮助。
Gregg Miskely has a blog post on why the service account needs to have admin privileges (when set up that way). One of the points is that the user account, in your case the user on the Test machine, must have privileges for connecting back to the other computer. It sounds like you are hitting a case where the account mydomain\user1 has insufficient privileges to connect to your development computer.
If that doesn't help perusing Gregg's blog posts, sending him mail could help.
TESTCOMPUTER\user1
的密码是否与mydomain\user1
相同?您还可以尝试在目标计算机上运行
msvsmon.exe
而不是远程调试服务。 您可以使用“运行方式...”在各种凭据下运行它。 一旦您使用msvsmon,exe
工作,您应该能够安装(或重新启用)远程调试器服务,使其在这些凭据下运行。编辑:
您应该能够使用
msvsmon.exe
中的“权限”属性页为目标计算机上的域用户设置适当的调试权限:http://msdn.microsoft.com/en-us/library/ms164722.aspx
Does
TESTCOMPUTER\user1
have the same password asmydomain\user1
?You can also try running
msvsmon.exe
on the target computer instead of the Remote Debugging Service. You can use "Run As..." to run it under various credentials. Once you get things working withmsvsmon,exe
you should be able to install (or re-enable) the Remote Debugger Service having it run under those credentials.EDIT:
You should be able to use the Permissions property page in
msvsmon.exe
to set up the appropriate debugging permissions for your domain user on the target machine:http://msdn.microsoft.com/en-us/library/ms164722.aspx
因此,您是一名开发人员,您的一个用户遇到了异常,并且您希望在不关闭异常窗口的情况下远程调试它,但他们以不同的用户帐户登录。 事实证明,您可以调试他们的应用程序,但这会变得很棘手。
0) 您仍然需要在远程应用程序计算机和本地 Visual Studio 计算机上匹配本地帐户,这意味着向用户计算机添加一个帐户。
1) 您需要使用带 /netonly 选项的 runas。 打开 msvsmon 所在文件夹的命令提示符,然后键入
这将导致 msvsmon 仅在访问网络时(例如,当 msvsmon 连接回本地 VS 计算机时)才使用用户的凭据。 如果您使用 runas 调用而不使用 /netonly,msvsmon 会感到不安。
2) 您需要通过远程调试监视器的“工具”->“权限”菜单为本地 Visual Studio 计算机添加连接远程应用程序计算机的权限。
So you're a developer and one of your users got an exception, and you want to debug it remotely without closing the exception window, but they're logged on as a different user account. As it turns out, you can debug their application, but it gets tricky.
0) You still need matching local accounts on both the remote app machine and the local Visual Studio machine, which means adding an account to the user's computer.
1) You need to use runas with the /netonly option. Open a command prompt to the folder where msvsmon is and type
This causes msvsmon to use the user's credentials only when accessing the network (e.g. when msvsmon connects back to the local VS machine). msvsmon will get upset if you call it with runas without using /netonly.
2) You need to add permissions for the local Visual Studio machine to connect the remote application machine, via the Remote Debug Monitor's Tools->Permissions menu.
所以没有帐户我无法回复,我只能回复我自己的评论,但我的注册帐户与我发布的匿名帐户是分开的,所以这必须是一个“新答案”。 对不起。
baget - 当我今天早些时候完成这项工作时,我在远程调试监视器 PC 和 Visual Studio PC 上创建了一个本地帐户。 RDM 不在域中,而 VS 则在域中。 两个本地帐户都是管理员,其凭据与我的域帐户相同。 我从另一个帐户(也是管理员)通过 netonly 开关在提升的提示符下调用 runas。 您可能需要也可能不需要向您的域提供用户名,但由于密码应该全部匹配,我认为这并不重要。
不要忘记调整 RDM 中的权限,以允许运行 VS 的用户帐户以调试权限进行连接。 它对允许您添加到列表中的人员非常挑剔,因此如果您不首先创建本地帐户,您会感到非常沮丧。 如果您在不同的用户帐户名下运行 RDM,则在尝试连接到远程计算机时必须使用完整的服务器名称; 如果您从同一用户帐户运行 RDM 和 VS,那么您只需使用计算机名称即可。
So I can't reply without an account, and I can only reply to my own comments, but my registered account is separate from the anonymous account I posted from, so this has to be a "new answer". Sorry.
baget - when I made this work earlier today, I created a local account on both the Remote Debug Monitor PC and Visual Studio PC. RDM was not on the domain, VS was. Both local accounts are administrator with credentials identical to my domain account. From a different account (also administrator) I called runas from an elevated prompt with the netonly switch. You may or may not need to provide your domain with the username, but since the passwords should all match I don't think it matters much.
Don't forget to adjust your permissions in the RDM to allow the user account running VS to connect with Debug privileges. It's pretty picky about who it lets you add to the list, so if you don't create the local account first you'll get pretty frustrated. And if you're running RDM under a different user account name, you have to use the full server name when trying to attach to the remote computer; if you run both RDM and VS from the same user account then you can get away with just the computer name.