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

  • Home
  • SEARCH
  • 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 573949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:46:44+00:00 2026-05-13T13:46:44+00:00

I am building a reusable framework for building scheduling services using the .NET Framework.

  • 0

I am building a reusable framework for building scheduling services using the .NET Framework. My code is distributed as a library, which is then referenced by the user in a console application. In the main entry point of the application, the user is asked to transfer control to a static method in the library, which will commence job scheduling if running in non-interactive mode, alternatively read command arguments and perform maintenance tasks such as installation.

In order to install the application as a Windows service using the System.Configuration.Install namespace, the user will have to add a class descendant of Installer to the application assembly, telling the framework how to install the service. I really would prefer to do this once and for all in the library, but unfortunately the installer class has to be in the application assembly.

The solution that I am looking at right now, involves defining the an installer class in the library, and requiring the user to inherit this in a public class, without adding any additional code. While this works, it requires the user to write annoying boiler plate code.

What are the alternatives to extending Installer? Can I access the managed installation framework in more direct way?

  • 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-05-13T13:46:45+00:00Added an answer on May 13, 2026 at 1:46 pm

    I use SC.exe to register the service binary.

    Doing so leaves only this stub in the service installer class:

    [RunInstaller(true)]
    public partial class SoapSenderInstaller : Installer
    {
        public SoapSenderInstaller()
        {
            InitializeComponent();
        }
    }
    

    Calling SC.exe is a simple as this:

    sc create MyService binpath= "C:\Path\to\my\MyService.exe" DisplayName= "My Service Display Name" depend= MSMQ start= auto
    

    The only pitfall is the way sc.exe expects its commmand line arguments:

    binpath=[BLANK]"MyService.exe"
    

    EDIT

    Of course this solution falls short to the requirement that user should not have to create any code that makes his binary a windows service because if he just references your library he would still need to inherit from ServiceBase and implement OnStart() and OnStop().

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

Sidebar

Ask A Question

Stats

  • Questions 298k
  • Answers 298k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I believe you're going at it from the wrong side:… May 13, 2026 at 7:26 pm
  • Editorial Team
    Editorial Team added an answer NO, IN SSMS right click on the table, and select… May 13, 2026 at 7:26 pm
  • Editorial Team
    Editorial Team added an answer You will be better off if you just rename your… May 13, 2026 at 7:26 pm

Related Questions

We are in the process of re-evaluating our usage of JSF (brought in before
I came across many resources about the difference between Django projects and reusable apps,
I am looking for reusable open source components. The level of depth, breadth and
I'm creating .net websites against a CMS server using the API of the software
This question was originary in my head as Can I use AWT controls in

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.