Search code examples
c#.netvb6configurationmanager

Reading app.config of a VB6 project from a C# dll library


I need to create a C# .NET DLL library that can read all the project configurations from a config file.

The main project was written in VB6, that calls my C# DLL library.

I created a test method that returns a cabled string and the call works correctly, so the VB6 to C# integration works.

My problem is that I use the System.Configuration.ConfigurationManager class to read the configuration file (App.config). It works if the call come from a C# test project but it doesn't work if the call became from VB6 project.

I think that the problem is caused by VB6 that don't read App.config file as project configuration file, how I can do that?


Solution

  • The problem is solved: I tried to rename App.config in myVB6AppName.exe.config but it doesn't work. The solution is including myVB6AppName.exe.config file in VB6 project as document. Now it works!