Solved

DLL's, Interop and App.Config.

Posted on 2009-06-29
1
1,009 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

749 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