app.config when using .Net dll as COM

  • Thread starter Thread starter babylon
  • Start date Start date
B

babylon

i have a .Net dll
and there are codes to access the AppSettings inside the dll

However, I would like to use the dll from a C++ program by wrapping the .Net
dll as a COM

So..how could I provide the app.config?

Thanks
 
You cannot. The app.config is tired to a running EXE, not just any
assembly. You will need to process the config settings yourself.
 
i have a .Net dll
and there are codes to access the AppSettings inside the dll
However, I would like to use the dll from a C++ program by wrapping the .Net
dll as a COM
So..how could I provide the app.config?

Well, you can easily create a "MyCOMApp.exe.config" file and place it
in the same directory where your C++ app is located - the .NET DLL
will pick it up and use it. I've done this - works like a charm. And
it doesn't interfere with your existing C++ app either.

But you have to manually create the file, give it the correct name,
and copy it to where your C++ EXE file resides.

Marc

================================================================
Marc Scheuner May The Source Be With You!
Berne, Switzerland m.scheuner -at- inova.ch
 
Back
Top