如何以特定用户身份调试 .net 应用程序?
我正在 Visual Studio 2008 中创建一个 WinForms 应用程序。
我想在调试器中运行我的应用程序,并且希望该应用程序以运行 Visual Studio 的用户以外的用户身份运行。最好的方法是什么?
I'm creating a WinForms application in Visual Studio 2008.
I want to run my application in the debugger and I want the application to run as a user other than the user running Visual Studio. What is the best way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您有权访问允许打开多个终端服务器会话的操作系统,则只需以该用户身份打开一个新的终端服务器会话即可。使用运行 Visual Studio 的管理员帐户,您应该能够在其他会话中调试该进程。
您可以向应用程序添加调用以以所需用户身份登录,但这并不理想,因为环境显然与以该用户身份运行的体验不同。
否则我认为你需要看看 VS 安装在单独的盒子上的远程调试场景。
If you have access to an OS that lets you have multiple terminal server sessions open, then simply open a new terminal server session as that user. With an administrator account running Visual Studio you should be able to debug the process in the other session.
You could add calls to your app to login as the desired user, but that isn't ideal since the environment is clearly not identical to the experience of running as that user.
Otherwise I think you need to look at remote debugging scenarios where VS is installed on a separate box.