简体   繁体   English

在VS2010中远程调试C#应用程序

[英]Remote debugging C# application in VS2010

I try to remote debug C# application (remote PC under WinXP (32bit), VS runs under Win7 (64bit) i got an error message: 我尝试远程调试C#应用程序(WinXP(32位)下的远程PC,VS在Win7(64位)下运行,我收到一条错误消息:

Error while trying to run project: Unable to start debugging. Logon failure: unknown user name or bad password. See help for more information.

On both machines i set-up user accounts with same name/password, and both machines locates on same work group in LAN. 在两台机器上,我设置了具有相同名称/密码的用户帐户,并且这两台计算机都位于LAN中的同一工作组中。

When I enabled login audit on WinXP I see strange record on event log, common sense of this is: login forbidden for user SYSTEM , but i run VS and remote debug moniton by another user name. 当我在WinXP上启用登录审核时,我在事件日志中看到奇怪的记录,常识是: login forbidden for user SYSTEM ,但是我用另一个用户名运行VS和远程调试moniton。

Can somebody explain me how to beat this strange error? 有人可以解释我如何击败这个奇怪的错误?

Upd: I tryed to run VS2010 as remote user with command: runas /user:pc_name\\user_name path_to_vs_ide then pass password. Upd:我尝试使用命令运行VS2010作为远程用户: runas /user:pc_name\\user_name path_to_vs_ide然后传递密码。 IDE was started succesfully, but when i choose "Attach to process..." and wrote pc_name in qualifier field, i got same error as above: Logon failure: unknown user name or bad password. IDE成功启动,但是当我选择“附加到进程...”并在限定符字段中写入pc_name时,我得到了与上面相同的错误: Logon failure: unknown user name or bad password.

So my question is still yet actual. 所以我的问题仍然存在。 How to remotely debug C# applications? 如何远程调试C#应用程序?

Upd2: Problem solved after install new pure copy of WinXP. Upd2: 安装WinXP的新纯副本后问题解决了。

Assume you have two computers, C1 and C2. 假设您有两台计算机,C1和C2。 You create a user Alex on both, and each copy of Alex has the same password. 您在两者上创建用户Alex,并且每个Alex副本都具有相同的密码。 Same user, right? 相同的用户,对吗?

These are not the same user login. 这些用户登录一样。 Each has a different unique identifier (UID). 每个都有不同的唯一标识符(UID)。

If you try to log in to C1 from C2 using "Alex" as the user name, the user you are using is the Alex from C2, not the Alex from C1, which is the principal the remote system will use to authenticate. 如果您尝试使用“Alex”作为用户名从C2登录C1,则您使用的用户是来自C2的Alex,而不是C1中的Alex,这是远程系统用于进行身份验证的主体。 But the remote system doesn't know who Alex from C2 is. 但远程系统不知道C2中的Alex是谁。

Try changing your remote credentials to your equivalent of "C1\\Alex": the remote computer name, a \\ , and the user name. 尝试将远程凭据更改为等效的“C1 \\ Alex”:远程计算机名称, \\和用户名。

You can see more info here on how to set up remote tools: http://msdn.microsoft.com/en-us/library/bt727f1t.aspx Gregg's blog is very useful for account requirements: http://blogs.msdn.com/b/greggm/archive/2008/05/15/visual-studio-remote-debugger-service-user-account-requirements.aspx 您可以在此处查看有关如何设置远程工具的更多信息: http//msdn.microsoft.com/en-us/library/bt727f1t.aspx Gregg的博客对帐户要求非常有用: http://blogs.msdn。 COM / b / greggm /存档/ 2008/05/15 /视觉工作室远程调试器服务的用户帐户requirements.aspx

You really want two local user accounts, one on host and remote host, with the same username and password (to have Visual Studio authenticate using a local account that matches a remote account (username and password) that has been given permissions to debug in msvsmon.exe) 您确实需要两个本地用户帐户,一个在主机和远程主机上,具有相同的用户名和密码(使Visual Studio使用与远程帐户(用户名和密码)匹配的本地帐户进行身份验证,该帐户已获得msvsmon中的调试权限。可执行程序)

Windows cached credentials - if you accessed a resource and checked “remember me”, Windows cached credentials to that resource. Windows缓存凭据 - 如果您访问了资源并选中了“记住我”,则Windows缓存该资源的凭据。 If you ever attempted to Attach To Process using the current user logged into the local machine, Visual Studio will pick up these cached credentials and attempt to use this as authentication for remote debugging. 如果您曾尝试使用登录到本地计算机的当前用户附加到进程,Visual Studio将获取这些缓存的凭据并尝试将其用作远程调试的身份验证。 So you'll need to clear these credentials (control userpasswords2, Advanced tab, Manage Passwords, Delete the credentials for that remote host) 因此,您需要清除这些凭据(控制userpasswords2,高级选项卡,管理密码,删除该远程主机的凭据)

Now you can either attempt to access the resource (like a share) using a different credential and store it, or you can run Visual Studio as that user you want to debug with that corresponds to the user on the remote side. 现在,您可以尝试使用不同的凭据访问资源(如共享)并将其存储,也可以运行Visual Studio作为您要调试的用户,该用户对应于远程用户。

Alex,您可能需要更改Windows XP计算机上的本地安全策略设置,这里有更多详细信息: http//msdn.microsoft.com/en-us/library/ek2256kk(v = vs.100).aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM