Config File for COM+

V

Vai2000

Hi All, I have created a COM+ Component Foo.dll, I was wondering where I can
store its Config File and what should I name it?
this COM+ Component calls a WebSvc too! the IDE Created an app.config for me
in the project workspace but somehow that isn't working....

TIA
 
V

Vai2000

I have written Serviced Component and need an XML Config for it as it calls
a WS whose WSDL changes frequently
and due to other reasons too, we need Config

TIA
 
N

Nicholas Paldino [.NET/C# MVP]

Vai2000,

You should be able to name it the name of the assembly that is the entry
point with an xml extension, and it should work (assuming that this is an
out of process component).

Hope this helps.
 
V

Vai2000

Well I tried creating foo.dll.config and dllhost.exe.config
but they aren't working. :(


Nicholas Paldino said:
Vai2000,

You should be able to name it the name of the assembly that is the entry
point with an xml extension, and it should work (assuming that this is an
out of process component).

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Vai2000 said:
I have written Serviced Component and need an XML Config for it as it calls
a WS whose WSDL changes frequently
and due to other reasons too, we need Config

TIA
------------------------------------------------------------------------- -
 
W

Willy Denoyette [MVP]

If it's a "library" type component, it's up to the calling EXE to read the
config file.
For a "server" type application it's not that easy. This is because the host
process is Dllhost.exe which can't/doesn't have a config file, all Server
types share the same host Dllhost.exe, you don't want your config file to be
used by all dllhosts.exe don't you?
Now what you could do is the following:
1. Set the application root of your COM+ application to a specific
directory, any directory will do, just make them different for each
application.
2. Create an application manifest file in this directory, name it
'application.manifest'. This file is just a normal manifest that describes
the dependencies. Note that this can be as simple as...
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
</assembly>
3 Add your normal config file to this same directory and rename it as
'application.config'
With this in place your COM+ server type application can access its own
config info through the normal API's.



Willy.
 
V

Vai2000

Great, thanks, that sounds convincing

Willy Denoyette said:
If it's a "library" type component, it's up to the calling EXE to read the
config file.
For a "server" type application it's not that easy. This is because the host
process is Dllhost.exe which can't/doesn't have a config file, all Server
types share the same host Dllhost.exe, you don't want your config file to be
used by all dllhosts.exe don't you?
Now what you could do is the following:
1. Set the application root of your COM+ application to a specific
directory, any directory will do, just make them different for each
application.
2. Create an application manifest file in this directory, name it
'application.manifest'. This file is just a normal manifest that describes
the dependencies. Note that this can be as simple as...
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
</assembly>
3 Add your normal config file to this same directory and rename it as
'application.config'
With this in place your COM+ server type application can access its own
config info through the normal API's.



Willy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top