Hi,

We don't use MSI, so can't help U there.  From a Win32 service viewpoint, we
wired the start service up to create the CComPtr<ICorRuntimeHost> , Unwap
our interface and call run, we then do a WaitForSingleObject - the service
stop signals this wait, which causing the WaitForSingleObject to return, we
then call stop on the CComPtr<ICorRuntimeHost>.  Some of the code is here:
http://weblogs.asp.net/mdavey/articles/79467.aspx

Later
http://weblogs.asp.net/mdavey

----- Original Message -----
From: "Chris Mullins" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 11, 2004 11:02 PM
Subject: [ADVANCED-DOTNET] Workstation / Server CLR for a Windows Service


Currently my .NET Windows Service loads using the Workstation CLR.

I'm looking for a mechanism by which I can create a Windows Service that
will be hosted using the Server CLR, and still allow me to continue
using the SeviceBase class and all of the ServiceInstaller classes.

In the normal "exe" case, it's easy enough to create a Win32 EXE that
calls CorBindToRuntimeEx, and then run my exe - but for a Windows
Service there are more issues (aren't there always?).

Today, my .NET service has a custom installer class that is run by the
MSI, and all of the Service code (Start / Stop, etc) is wired up. If I
write a Win32 Service that creates the runtime and then launches my
code, there is no 'easy' way to have the Service installed by the MSI
engine, and I don't see how I can wire the Win32 Service up to the
Start/Stop methods in the CLR Service base class.

Has anyone come up with a good solution for running a .NET Service using
the Server CLR that doesn't have these drawbacks?

My application is going to often be running on a dual or quad boxes, so
the server version of the CLR seems worthwhile - but if it affects the
reliability of the installer, or of the ability of the service to start
cleanly, then I'm going to have to stick with the workstation version...

--
Chris Mullins

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to