Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7870637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:40:32+00:00 2026-06-03T01:40:32+00:00

I created a window service and to install it I created its deployment project

  • 0

I created a window service and to install it I created its deployment project and installed that. After installing I stared it. It successfully started.

Next day I made some modification, and rebuild and reinstalled but now its not installing.

Then I thought its issue with installer, lets create a custom installer for service so that anytime I can update my code.

I created it like this incase if anyone need this for future.

public class MyInstaller : Installer
    {
        ServiceProcessInstaller spi;
        ServiceInstaller si;
        public MyInstaller()
        {            
            spi = new ServiceProcessInstaller();
            spi.Account = ServiceAccount.LocalSystem;

            si = new ServiceInstaller();
            si.StartType = ServiceStartMode.Manual;
            si.ServiceName = "MyService";
            si.DisplayName = "My Service";
            si.Description = "service installed from command line";

            this.Installers.Add(spi);
            this.Installers.Add(si);

        }
}

I called it from main method by check the parameter args.

                            case "-i":
                            case "-install":
                                ti = new TransactedInstaller();
                                mi = new MyInstaller();
                                ti.Installers.Add(mi);
                                string logPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\install.log";
                                ctx = new InstallContext(logPath, cmdline);
                                ti.Context = ctx; //.Context ( ctx );
                                ti.Install(new Hashtable());
                                break;

Now when I am trying to install. I recevied error System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.

I google it, and come to know service will try to access application log while installing and write log there.

I am not writing any event log. I have my log4net for logging. But still its default behaviour.

How to overcome this issue now? Its not getting installed even I have all permissions.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T01:40:33+00:00Added an answer on June 3, 2026 at 1:40 am

    I have found that at times you may need to “Run as Administrator”. If you are installing from a command prompt you may need to start that up with “Run as Administrator”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a windows service and have created a setup project to install
I have created a Win32 Service using C++ and installed to the Services Successfully.
I've created a Windows Service that uses WCF for communications to it. The service
I have created a simple windows service that periodically checks a remote database via
We have created a WCF service hosted in a windows service that handles Authentication
Currently, I have a project with a Windows Service. I also created another Setup
The problem i'm having is that i've created a web service, and a windows
I'm trying to install service which I created in visual studio 2008 on windows
I created a service which I now want to install to test, I created
I created a windows service in VS:File->New Project->C#->Windows Services But I don't know how

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.