471,350 Members | 1,874 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,350 software developers and data experts.

app.config when using .Net dll as COM

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
Jul 21 '05 #1
2 1388
You cannot. The app.config is tired to a running EXE, not just any
assembly. You will need to process the config settings yourself.

"babylon" <ba*****@hotmail.com> wrote in message
news:#w**************@TK2MSFTNGP12.phx.gbl...
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

Jul 21 '05 #2
>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
Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by PMac | last post: by
17 posts views Thread by Fred Nelson | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.