Using EnterpriseServiceHost

Using EnterpriseServiceHost

Old forum URL: forums.lhotka.net/forums/t/1520.aspx


don012001 posted on Tuesday, October 17, 2006

I tried using "Enterpriseservicehost" for testing the PTWeb application. I have registered the "EnterpriseServicesHostcs" component as well in COM+.

The application is expecting the COM+ runtime to look for configuration details in the application.config file.

At runtime the COM+ runtime looks for "C:\WINNT\system32\dllhost.exe.config" for configuration details.

Because of that we are getting runtime errors. Any workaround for this.

Appreciate any quick help.

-DON.

RockfordLhotka replied on Tuesday, October 17, 2006

Yes, follow the instructions in Chapter 12 for configuring the enterprise services host. You need to set a property in the COM+ Application through MMC to tell it where to find the config file.

don012001 replied on Wednesday, October 18, 2006

I'm using WIN2K server as development and deployment machine. In that case the procedure we are following is not useful right. Pls correct me If I'm wrong.

-DON.

RockfordLhotka replied on Wednesday, October 18, 2006

Yeah, with Win2k I think you need to put the config file in the same directory as dllhost itself... Not a good answer.
 
I think that Clemens Vasters had once blogged a workaround to this issue - it involved mucking about fairly deep in .NET, but I seem to recall he had a solution - google is probably your friend there.
 
Rocky


From: don012001 [mailto:cslanet@lhotka.net]
Sent: Wednesday, October 18, 2006 1:30 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] Using EnterpriseServiceHost

I'm using WIN2K server as development and deployment machine. In that case the procedure we are following is not useful right. Pls correct me If I'm wrong.

-DON.




don012001 replied on Thursday, October 19, 2006

Rocky,

We can make our code work with Enterprise Services (COM+) in 2 ways.

1. having a file dllhost.exe.config created and place it under <windows Folder>\System32, and place the config details in this file.

2. Change the class definition of

public class EnterpriseServicesPortal :  Csla.Server.Hosts.EnterpriseServicesPortal
{
      // no code needed - implementation is in the base class
}

to

public class EnterpriseServicesPortal : Csla.Server.Hosts.EnterpriseServicesPortal
{
      
public EnterpriseServicesPortal() : base()
      {
            
AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", <path>\app.config"); 
      }
      
 // no code needed - implementation is in the base class
} 

 

This is working fine with me.

-DON.

Copyright (c) Marimer LLC