Solved

DLL's, Interop and App.Config.

Posted on 2009-06-29
1
1,005 Views
Last Modified: 2013-11-08
I need to read the value of an app.config file from a .NET DLL through Interop from a VB6 app.
The DLL is part of a larger winform app - but I am just using the DLL for the Interop.
But of course you cannot read an app.config from just a DLL - it needs to be in an app with an exe file associated. I get nothing when I try and read the app.config using the usual .NET routines in this COM Interop situation.
So, how can this be done in real life?
Can I send my setting value through the interop into DLL for the .NET DLL to store this where it can be read as if the DLL had an app.config?
NOTE: I have tried reading froam the app directory but in Interop this appears to be the VB6 runtime directory.

0
Comment
Question by:BrianGilbert
1 Comment
 
LVL 4

Accepted Solution

by:
Woodz earned 125 total points
ID: 24736608
Have you tried using the ConfigurationManager.OpenExeConfiguration method, specifying the path to the config file?
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question