Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
B

Brett G 0

@Brett G 0
About
Posts
4
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Eyeball game
    B Brett G 0

    My eyes must be working well this morning, 3.64 first time

    The Lounge php visual-studio linq com game-dev

  • C# Windows Service - Issue Creating Multiple Services in 1 Project
    B Brett G 0

    Just realized that I only had one service installer set up. Added a second installer for the other service and things are running much better now. Thanks!

    C# help csharp docker tutorial

  • C# Windows Service - Issue Creating Multiple Services in 1 Project
    B Brett G 0

    Hello all: I am having a problem with a Windows Service that I'm writing in C# using Studio 2003. The main service will start fine, but for some reason the OnStart() and OnStop() methods in the additional service never fire on their own. As a workaround, in the second service I added a line to the InitializeComponent() method to call OnStart() since the Initialize method is actually called. This works as a workaround to get the service doing what it should, but then the OnStop() is never used and this seems a little odd to me. It does work this way, but I can't believe this is how it should be and I would like to have it running right. If you have any ideas, any help would be appreciated. Main Method in first service:

    // The main entry point for the process
    static void Main()
    {
    System.ServiceProcess.ServiceBase[] ServicesToRun;

    // More than one user Service may run within the same process. To add
    // another service to this process, change the following line to
    // create a second service object. For example,
    //
    //   ServicesToRun = new System.ServiceProcess.ServiceBase\[\] {new Service1(), new MySecondUserService()};
    //
    
    ServicesToRun = new System.ServiceProcess.ServiceBase\[\] { new MendsInterface(), new       MendsToAllscripts()};
    
    System.ServiceProcess.ServiceBase.Run(ServicesToRun);
    }
    

    Initialize Method in the second service:

    private void InitializeComponent()
    {
    components = new System.ComponentModel.Container();
    this.ServiceName = "MendsToAllscripts";

    \_common.LogMessage("Initializing Allscript service");
    
    OnStart(null);
    

    }

    Thank you!

    C# help csharp docker tutorial

  • Who listens to music while they code?
    B Brett G 0

    I listen to music most of the day. I started working from home a few months ago and was starting to get sick of regular radio so I decided to sign up for Sirius and now have that playing pretty much all day at home. Brett

    The Lounge question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups