Click here to Skip to main content
15,889,863 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,

I'm building one solution with two projects:

1. Windows Service.

The windows service starts with this code:

ManagementGroup mg = new ManagementGroup("localhost");

2. Console Application.

When the Windows service starts the console application must use the management group connection from the service. If the service doesn't start my console application must give an error. The error is no problem, but how do i call code from the other project.

Can you give me a little example of how to do this?

Kind regards,

André
Posted

See Mark Gravell's solution here: https://groups.google.com/forum/?hl=en#!topic/microsoft.public.dotnet.languages.csharp/TUXp6lRxy6Q[^] (you could find it more clearly in my article[^]).
You can extend the entry point of that executable to perform the task you need.
 
Share this answer
 
I have develop exactly this approach. Please look at my past answer to get some key ideas: Configure Windows Service with UI[^].

If you need more help with it, please ask your follow-up questions.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900