1

I have a .NET Windows service that was created using Visual Studio 2017 and tested on a Windows 7 PC.

I have now installed it on a Windows 10 PC, but when I start the service, I get the following error:

Visual Studio Just In Time Debugger:
An unhandled Microsoft .NET Framework exception occurred in 'MyService'. The Just-In-Time debugger was launched without necessary security permissions. To debug this process, the JIT debugger must be run as an administrator. Would you like to debug the process?

If I click Yes, it attempts to start a new instance of Visual Studio 2010 which is not installed on the PC (and I cannot install it). If I click No, it aborts the service.

I cannot see any error in the Windows Events log.

How can I turn off the just-in-time debugger so that I can see meaningful debug messages from my windows service?

I have attempted to catch error or even log info to file but I do not see any output from either Trace or my log file does not get written to:

enter image description here

Harry Boy
  • 4,159
  • 17
  • 71
  • 122
  • id be surprised if its not mentioned in the event viewer. However, the most appropriate way to deal with this, capture the error and log it – TheGeneral Oct 29 '18 at 10:47
  • See my edit. I do not see any trace info or can not write to a text file. It seems to blow up before the main gets called. Any ideas. – Harry Boy Oct 29 '18 at 11:52
  • How are you starting the service? Are you sure the call to File.WriteAllText (outside of the try) isn't failing? And is the service running in the LocalSystem account or have you configured another account? – CoreTech Oct 29 '18 at 13:01
  • I have both another service that starts it AND I have started it from the commandline using "net start MyServiceName". Both produce the same results. – Harry Boy Oct 29 '18 at 13:04
  • I hope this post help you: [How to stop “Just In Time Debugging” messages blocking a buildserver](https://stackoverflow.com/a/1893616/6459022) – J.Calmet Dec 03 '18 at 12:28

0 Answers0