开发者

Visual Studio Remote Debugging a service

开发者 https://www.devze.com 2023-03-21 09:33 出处:网络
I\'m trying to remote debug a service using visual studio 2005. When I run msvsmon.exe as an application, I get the UI and I can change it to noauth and anyuser, then when i try to attach to the proc

I'm trying to remote debug a service using visual studio 2005.

When I run msvsmon.exe as an application, I get the UI and I can change it to noauth and anyuser, then when i try to attach to the process from visual studio remotely, i get an erro saying that it can't attach to a process being run in a session that msvsmon.exe isn't running in. The session of the service is 0.

So I can successfully run msvsmon.exe as a service, but I can't set it up to be in /no开发者_运维知识库auth and /anyuser mode.

The binPath for the service is: "c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86\msvsmon.exe" /service msvsmon90

both /noauth and /anyuser are the commandline switches for msvsmon.

Filling out the 'start parameters' in the service properties window doesn't affect anything.

changing the binPath of the service to:

"c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86\msvsmon.exe" /service msvsmon90 /noauth /anyuser

also does not work (as the service fails to start properly).

How do i get the remote debugging monitor to run as a service in noauth and anyuser mode?


Not sure if this would work for you, but have you tried using psexec (from sysinternals) to run msvsmon interactively on session 0?

The command-line would be something like this (from an elevated command-prompt):

psexec –sd –i 0 "c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86\msvsmon.exe" /noauth /anyuser

I'm doing something similar to debug some code when logging off of Windows.


You will need an additional switch that supresses the warning since the program will actually not start but stuck in a warning message this case (you can check btw when add a /port:xxx argument and see that without the supressing there are no listener at the specified port).

So the working example:

    psexec –sd –i 0 "c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86\msvsmon.exe" /noauth /anyuser /port:4000 /nosecuritywarn


Another useful switch is /nowowwarn suppressing warnings for Win32 monitor on 64-bit machine. For the comprehensive list of all available switches run \msvsmon /?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号