How to debug logon screensaver in Win7?
I have a .Net 2.0 开发者_StackOverflow中文版WinForms app that I'm trying to use as a logon screensaver (64-bit Win7Pro). It runs just fine from the command line when I'm logged in and as my screensaver. However, it exits immediately when run as a logon screensaver.
I know it's getting a CLR exception because its exit code is 0xE0434F4D, but I can't figure out how to debug it.
Is there any way to debug a logon screensaver in Win7?
You may be able to debug by attaching to the process from a remote computer through Visual Studio.
However, there may be a simpler solution. WinForms applications have a Program class. If you put a Try--Catch phrase around the code in the Program class that starts your Form, then when the application crashes you can log the Exception with full stacktrace. From there you should be able to more readily determine the problem (which my guess would be privilege related) and correct it.
If you want to debug the logon screen, you'll need a kernel debugger attached.
msvsmon and the rest won't run from the logon screen as there's no user session (since you haven't logged in yet).
Debugging CLR from the kernel debugger will be interesting; it's possible to get some basic CLR debugging going from windbg, but it won't be simple.
You might just create a log file (or use Event Tracing for Windows, which avoids a ton of security issues) to track down the failure.
精彩评论