VB6, VB.NET dll can't read app.config file while debugging

silentthread2k
silentthread2k used Ask the Experts™
on
   I'm trying to debug a dll in Visual Studio. It's a vb.net dll that used to be a vb6 dll. (Converted via wizard)
    It turns out that my vb.net dll cannot read configuration settings from the app.config file.
    It does not throw an error, it just shows the values as null in the debugger.
    Is there something special about app.config files in vb.net dlls?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2007
Commented:
Deburah Kuratah's book "Doing Objects in Visual Basic 2005" notes that the .NET Framework does not provide a configuration file model for class libraries; which means that when you run the application, the app.config file for any class library is ignored.  You have to manually copy any settings from the app.config file defined for any Class Library project into the app.config file for the application, which is defined in the startup Windows Application project.  (p. 481)

Commented:
Class library can not execute independently. It is used in another application so it is point to that application configuration file . If you are suing VB 6 so vb 6 does  not support configuration file so best way is to create one XML file and VB 6 and read that XML file from Class library to read setting.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial