I have code written in .NET that only fails when installed as a Windows service. The failure doesn\'t allow the service to even start. I can\'t figure out how I can step int
As others have pointed out, you have to add a debugger break to the OnStart-Method:
#if DEBUG
System.Diagnostics.Debugger.Break()
#endif
Also start VisualStudio as Administrator and allow, that a process can automatically be debugged by a different user (as explained here):
reg add "HKCR\AppID\{E62A7A31-6025-408E-87F6-81AEB0DC9347}" /v AppIDFlags /t REG_DWORD /d 8 /f
(I also explained this here: https://stackoverflow.com/a/35715389/5132456 )