Solved

DLL's, Interop and App.Config.

Posted on 2009-06-29
1
1,001 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

808 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