C#: Simple Windows Service gives Security Exception

后端 未结 4 613
不思量自难忘°
不思量自难忘° 2021-02-13 13:43

I am doing the walkthrough in the following link: http://msdn.microsoft.com/en-us/library/zt39148a%28VS.80%29.aspx

I have followed it exactly, line by line. I installed

4条回答
  •  盖世英雄少女心
    2021-02-13 14:20

    Are you a local administrator on your machine? If so, put the following line of code at the top of the constructor of your windows service:

    System.Diagnostics.Debugger.Break();
    

    When the service starts to run, it'll hit this breakpoint, allowing you to jump into Visual Studio. You can then debug from there until you discover where the exception is occurring.

提交回复
热议问题