Problems calling a COM+ component
-
Hi, I've got a problem, calling via remoting, a COM+ which activation is type library. I configure the client application and the web.config file, then I make the call, and that's ok. The problem appears because my COM+ application has to read information from a configuration file. My first attempt to solve this, was to introduce this information in the web.config file, but it doesn't work. The fact is that the configuration file which it's been read is aspnet_wp.exe.config, instead web.config. I am creating the COM+ through a wrapper. When I call the wrapper, it is executed in one AppDomain, but when the wrapper creates the instance of the component, the AppDomain is changed to the Default AppDomain, changing also the configuration file used. I hope to give enough information (and understable!!!;P) If you need further information, please, don't hesitate asking me. Thanks, Ivan. Iván Fernández
-
Hi, I've got a problem, calling via remoting, a COM+ which activation is type library. I configure the client application and the web.config file, then I make the call, and that's ok. The problem appears because my COM+ application has to read information from a configuration file. My first attempt to solve this, was to introduce this information in the web.config file, but it doesn't work. The fact is that the configuration file which it's been read is aspnet_wp.exe.config, instead web.config. I am creating the COM+ through a wrapper. When I call the wrapper, it is executed in one AppDomain, but when the wrapper creates the instance of the component, the AppDomain is changed to the Default AppDomain, changing also the configuration file used. I hope to give enough information (and understable!!!;P) If you need further information, please, don't hesitate asking me. Thanks, Ivan. Iván Fernández
I don't think what you are trying to do is possible. As far as I know, .config files can only be used with applications (theapp.exe.config) or ASP.NET (web.config). You would find that if your COM+ application used Server (as opposed to Library) Activation, to config file that the .NET framework would try to load would be
dllhost.exe.config
. I assume one could try to force the .NET classes used to read the configuration to load the info from a specific file, but I've never used them myself (I don't even know which are used :-O ) If anyone knows any better, or if I am talking rubbish, please correct me. :)Searching the web without Google is like straining sewage with your teeth.
Userfriendly, 2003/06/07 -
I don't think what you are trying to do is possible. As far as I know, .config files can only be used with applications (theapp.exe.config) or ASP.NET (web.config). You would find that if your COM+ application used Server (as opposed to Library) Activation, to config file that the .NET framework would try to load would be
dllhost.exe.config
. I assume one could try to force the .NET classes used to read the configuration to load the info from a specific file, but I've never used them myself (I don't even know which are used :-O ) If anyone knows any better, or if I am talking rubbish, please correct me. :)Searching the web without Google is like straining sewage with your teeth.
Userfriendly, 2003/06/07I can't use the COM+ application like Server because I don't want to have any dll in the GAC. I want to use probing to indicate where my application has to search for the asssemblies. I could use another file to read the configuration information, like you said, but the probing information, as far as I know, has to be in the application config file. Any other suggestion?? Thanks!! Iván Fernández
-
Hi, I've got a problem, calling via remoting, a COM+ which activation is type library. I configure the client application and the web.config file, then I make the call, and that's ok. The problem appears because my COM+ application has to read information from a configuration file. My first attempt to solve this, was to introduce this information in the web.config file, but it doesn't work. The fact is that the configuration file which it's been read is aspnet_wp.exe.config, instead web.config. I am creating the COM+ through a wrapper. When I call the wrapper, it is executed in one AppDomain, but when the wrapper creates the instance of the component, the AppDomain is changed to the Default AppDomain, changing also the configuration file used. I hope to give enough information (and understable!!!;P) If you need further information, please, don't hesitate asking me. Thanks, Ivan. Iván Fernández
What it comes down to is the CLR host. The ASP.NET host is hardcoded to use the Web.config file as its configuration file. The executable loader by default uses yourapp.exe.config. In your case, it's odd that aspnet_wp.exe.config is being used. In any case, if you are using a wrapper, perhaps your wrapper has a chance to create the
AppDomain
that hosts the COM+ service itself? If so, when you are configuring theAppDomain
, you can specify any .config file you want so long as the CLR can resolve the location. SeeAppDomain.SetupInformation
for more details.-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----