I have a COM+ server (project output dll) which is consumed from a proxy (I guess this is called client applcation and runs under dllhost.exe). The COM+ server runs through a server console application (project output exe) which itself runs as a service.
I need to read a configuration file in COM+ server (dll). I do not know
I have found this link here, but I cannot figure out what to do. Thanks
1) In the COM+ application root directory you must place two files:
application.manifest
application.config
2) Your application.manifest
file can have just this content:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
</assembly>
3) Your application.config
file must be similar to this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="myPropertyName" value="myPropertyValue"></add>
</appSettings>
</configuration>
4) In the COM+ sorce code, you can use
System.Configuration.ConfigurationSettings.AppSettings["myPropertyName"]
in order to read a configuration property (if you are using C#).
NOTE: the "application root directory" can be determined by using the COM+ administration console (dcomcnfg.exe
), "Activation" tab.