Using app.config with Interop controls

I have a .net project (MySolution.Common) that uses app.config. I am using the MySolution.Common project in an InteropUserControl project called MySolution.InteropCtrl. MySolution.InteropCtrl is built into the VB6 project. When MySolution.InteropCtrl is in a VB6 project, it cannot find the app.config file. Everything in InteropControl works in VB6, except that it depends on the information in the app.config file. What do I need to change so that MySolution.InteropCtrl can see the app.config file in VB6?

+5
source share
3 answers

I am not 100% sure. But I will lay out some possibilities. First of all, app.config is not the correct name for the file. Although this is app.config in your project, it is automatically renamed to binary.exe.config or binary.dll.config (depending on the type of project), where the binary name is the name of the project.

Secondly, I am not 100% sure if the dll.config files always load correctly and read .NET when the application loads. I do not think that this happens automatically, and that there is an additional call that you must make to read the configuration file, if it is for dll. If you create a configuration file in accordance with your exe, it will download and be available to you.

+8
source

:

1) vb.exe , VB6.exe.config.

2) IDE, MyApp.exe MyApp.exe.config, exe, .

+1

All Articles