Visual Studio (VS2008)中的远程调试,Windows窗体应用程序。

时间:2022-09-21 02:52:08

I'm trying to Remote Debugging a Windows Forms Application (C#), but i'm always getting this error:

我试图远程调试一个Windows窗体应用程序(c#),但是我总是会得到这个错误:

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.

无法连接到名为“XXX”的Microsoft Visual Studio远程调试监视器。目标计算机上的Visual Studio远程调试器不能连接回此计算机。身份验证失败。请帮忙寻求帮助。

I tried to config according to the MSDN guides but i was not able to make it work.

我试着根据MSDN指南来配置,但是我不能让它工作。

My setup:

  • Development Computer - XP (x86) that is connected to a domain.
  • 开发计算机- XP (x86),连接到一个域。
  • Test Computer - Vista (x86) that is NOT connected to a domain.
  • 测试未连接到域的计算机- Vista (x86)。
  • 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.
  • 我在测试计算机(user1)中创建了一个本地用户,使用我运行Visual Studio (mydomain\user1)的域用户名。设置相同的密码。
  • 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):

    在测试计算机上,我正在运行“msvsmon”。exe作为应用程序(而不是作为服务),我使用“runas”命令对我创建的用户运行它。(user1):

    runas /u:user1 msvsmon.exe

    runas / u:user1 msvsmon.exe

Can Someone help me please?

谁能帮帮我吗?

Thanks.

谢谢。

6 个解决方案

#1


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.

远程计算机:微软虚拟PC,“IHS\RDM”附加到我的公司域,登录为jdoe,管理员帐户。

Local computer: Attached to local domain, logged in as jdoe, administrator account.

本地计算机:附加到本地域,作为jdoe登录,管理员帐户。

1) remote computer: install rdbgsetup.exe (from Visual Studio 2005\Disk 2\Remote Debugger\x86)

1)远程计算机:安装rdbgsetup。exe(来自Visual Studio 2005\Disk 2\Remote Debugger x86)

2) Remote computer: RUNAS /user MYDOMAIN\jdoe /netonly msvsmon

2)远程计算机:RUNAS / myuser domain \jdoe /netonly msvsmon

3) Remote computer: msvsmon->Tools->permissions add user "MYDOMAIN\jdoe" (I have to do this every time I re-start)

3)远程计算机:msvsmon->工具->权限添加用户“MYDOMAIN\jdoe”(我每次重新启动时都必须这样做)

4) local computer: run msvsmon.

4)本地计算机:运行msvsmon。

5) local computer, msvsmon->Tools->permissions, add object types: "computers", "IHS\RDM"

5)本地计算机,msvsmon->工具->权限,添加对象类型:“计算机”,“IHS\RDM”

6) local computer, vs2005->debug->attach to process. Transport: Default, Qualifier: jdoe@RDM

6)本地计算机,vs2005->调试->附加到进程。交通:默认情况下,限定符:jdoe@RDM

7) Refresh, and voila; a process list!

7)刷新,瞧;一个进程列表!

#2


9  

The problem that I had is that I had 2 users:

我遇到的问题是我有两个用户:

mydomain\user1
mytestmachine\user1

that is not correct (according to Gregg Miskely) i needed to define a local user in my development computer, for example:

这是不对的(根据Gregg Miskely的说法)我需要在我的开发计算机中定义一个本地用户,例如:

mydevcomputer\debug
mytestmachine\debug

with the same password and run the VS2008 and the Debugging Monitor with this user:

使用相同的密码并运行VS2008和该用户的调试监视器:

#3


2  

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.

Gregg Miskely在博客上发表了一篇文章,阐述了为什么服务账户需要拥有管理权限(如果这样设置的话)。其中一点是,用户帐户(在您的例子中是测试机器上的用户)必须具有连接到另一台计算机的特权。听起来您遇到了这样的情况:帐户mydomain\user1没有足够的权限连接到您的开发计算机。

If that doesn't help perusing Gregg's blog posts, sending him mail could help.

如果这对阅读葛雷格的博客文章没有帮助的话,给他发邮件可能会有帮助。

#4


1  

Does TESTCOMPUTER\user1 have the same password as mydomain\user1?

TESTCOMPUTER\user1是否有与mydomain\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 with msvsmon,exe you should be able to install (or re-enable) the Remote Debugger Service having it run under those credentials.

您也可以尝试运行msvsmon。在目标计算机上的exe,而不是远程调试服务。您可以使用“Run As…”在各种凭证下运行它。使用msvsmon后,您应该能够安装(或重新启用)远程调试器服务,让它在这些凭据下运行。

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:

您应该能够使用msvsmon中的权限属性页。exe在目标计算机上为域用户设置适当的调试权限:

http://msdn.microsoft.com/en-us/library/ms164722.aspx

http://msdn.microsoft.com/en-us/library/ms164722.aspx

#5


1  

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.

0)仍然需要在远程应用程序机器和本地Visual Studio机器上匹配本地帐户,这意味着向用户的计算机添加帐户。

1) You need to use runas with the /netonly option. Open a command prompt to the folder where msvsmon is and type

1)您需要使用带有/netonly选项的runas。打开一个命令提示符到msvsmon所在的文件夹并输入

runas /user:[user] /netonly msvsmon

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.

这导致msvsmon仅在访问网络时才使用用户的凭据(例如,msvsmon连接回本地VS机器时)。如果你使用runas而不使用/netonly, msvsmon将会感到不安。

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.

2)您需要为本地Visual Studio机器添加权限,以便通过远程调试监视器的Tools-> permissions菜单连接远程应用程序机器。

#6


0  

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.

当我今天早些时候完成这项工作时,我在远程调试监视器PC和Visual Studio PC上创建了一个本地帐户。RDM不在域中,VS在。两个本地帐户都是管理员,具有与我的域帐户相同的凭证。我从另一个帐户(也是管理员)用netonly交换机从一个高级提示符调用runas。你可能需要也可能不需要为你的域名提供用户名,但是由于密码应该都匹配,我认为这并不重要。

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.

不要忘记调整RDM中的权限,以允许用户帐户运行VS与调试权限连接。如果你不先创建本地帐户,你会非常沮丧。如果在不同的用户帐户名下运行RDM,您必须在尝试连接到远程计算机时使用完整的服务器名;如果您同时运行RDM和VS,来自同一个用户帐户,那么您可以只使用计算机名。

#1


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.

远程计算机:微软虚拟PC,“IHS\RDM”附加到我的公司域,登录为jdoe,管理员帐户。

Local computer: Attached to local domain, logged in as jdoe, administrator account.

本地计算机:附加到本地域,作为jdoe登录,管理员帐户。

1) remote computer: install rdbgsetup.exe (from Visual Studio 2005\Disk 2\Remote Debugger\x86)

1)远程计算机:安装rdbgsetup。exe(来自Visual Studio 2005\Disk 2\Remote Debugger x86)

2) Remote computer: RUNAS /user MYDOMAIN\jdoe /netonly msvsmon

2)远程计算机:RUNAS / myuser domain \jdoe /netonly msvsmon

3) Remote computer: msvsmon->Tools->permissions add user "MYDOMAIN\jdoe" (I have to do this every time I re-start)

3)远程计算机:msvsmon->工具->权限添加用户“MYDOMAIN\jdoe”(我每次重新启动时都必须这样做)

4) local computer: run msvsmon.

4)本地计算机:运行msvsmon。

5) local computer, msvsmon->Tools->permissions, add object types: "computers", "IHS\RDM"

5)本地计算机,msvsmon->工具->权限,添加对象类型:“计算机”,“IHS\RDM”

6) local computer, vs2005->debug->attach to process. Transport: Default, Qualifier: jdoe@RDM

6)本地计算机,vs2005->调试->附加到进程。交通:默认情况下,限定符:jdoe@RDM

7) Refresh, and voila; a process list!

7)刷新,瞧;一个进程列表!

#2


9  

The problem that I had is that I had 2 users:

我遇到的问题是我有两个用户:

mydomain\user1
mytestmachine\user1

that is not correct (according to Gregg Miskely) i needed to define a local user in my development computer, for example:

这是不对的(根据Gregg Miskely的说法)我需要在我的开发计算机中定义一个本地用户,例如:

mydevcomputer\debug
mytestmachine\debug

with the same password and run the VS2008 and the Debugging Monitor with this user:

使用相同的密码并运行VS2008和该用户的调试监视器:

#3


2  

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.

Gregg Miskely在博客上发表了一篇文章,阐述了为什么服务账户需要拥有管理权限(如果这样设置的话)。其中一点是,用户帐户(在您的例子中是测试机器上的用户)必须具有连接到另一台计算机的特权。听起来您遇到了这样的情况:帐户mydomain\user1没有足够的权限连接到您的开发计算机。

If that doesn't help perusing Gregg's blog posts, sending him mail could help.

如果这对阅读葛雷格的博客文章没有帮助的话,给他发邮件可能会有帮助。

#4


1  

Does TESTCOMPUTER\user1 have the same password as mydomain\user1?

TESTCOMPUTER\user1是否有与mydomain\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 with msvsmon,exe you should be able to install (or re-enable) the Remote Debugger Service having it run under those credentials.

您也可以尝试运行msvsmon。在目标计算机上的exe,而不是远程调试服务。您可以使用“Run As…”在各种凭证下运行它。使用msvsmon后,您应该能够安装(或重新启用)远程调试器服务,让它在这些凭据下运行。

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:

您应该能够使用msvsmon中的权限属性页。exe在目标计算机上为域用户设置适当的调试权限:

http://msdn.microsoft.com/en-us/library/ms164722.aspx

http://msdn.microsoft.com/en-us/library/ms164722.aspx

#5


1  

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.

0)仍然需要在远程应用程序机器和本地Visual Studio机器上匹配本地帐户,这意味着向用户的计算机添加帐户。

1) You need to use runas with the /netonly option. Open a command prompt to the folder where msvsmon is and type

1)您需要使用带有/netonly选项的runas。打开一个命令提示符到msvsmon所在的文件夹并输入

runas /user:[user] /netonly msvsmon

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.

这导致msvsmon仅在访问网络时才使用用户的凭据(例如,msvsmon连接回本地VS机器时)。如果你使用runas而不使用/netonly, msvsmon将会感到不安。

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.

2)您需要为本地Visual Studio机器添加权限,以便通过远程调试监视器的Tools-> permissions菜单连接远程应用程序机器。

#6


0  

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.

当我今天早些时候完成这项工作时,我在远程调试监视器PC和Visual Studio PC上创建了一个本地帐户。RDM不在域中,VS在。两个本地帐户都是管理员,具有与我的域帐户相同的凭证。我从另一个帐户(也是管理员)用netonly交换机从一个高级提示符调用runas。你可能需要也可能不需要为你的域名提供用户名,但是由于密码应该都匹配,我认为这并不重要。

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.

不要忘记调整RDM中的权限,以允许用户帐户运行VS与调试权限连接。如果你不先创建本地帐户,你会非常沮丧。如果在不同的用户帐户名下运行RDM,您必须在尝试连接到远程计算机时使用完整的服务器名;如果您同时运行RDM和VS,来自同一个用户帐户,那么您可以只使用计算机名。