System.Security.SecurityException exception Resolution for C # Windows Service installation

Source: Internet
Author: User

I wrote the install and enable service commands for registering Windows services to the bat executable (named Install.bat), as follows:

%systemroot%\microsoft.net\framework\v4.0.30319\installutil.exe CableAnti.Service.exe
Net Start Checkonlineservice
sc config checkonlineservice start= auto

Then I double-click on this bat file on Windows Server 2008r2, and the cmd command box actually flashed through and never gave a point!

I then right-click Install.bat to run as administrator. I'm scrubbing!!

Was forced to have no way, had to open cmd, switch to Install.bat directory, and put "%systemroot%\microsoft.net\framework\v4.0.30319\installutil.exe CableAnti.Service.exe "Copy to command line,

Enter the run, witness the miracle of the time to come,

Later found a degree Niang several times, I tried the following methods:

(1) Run cmd as Administrator;

(2) The path of CMD is then adjusted to the path where the bat file is located, for example, the path is "D:\Debug".

(3) and then enter "Install.bat" in cmd to install correctly.

Remember it for a later offense!

System.Security.SecurityException exception Resolution for C # Windows Service installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.