views:

1155

answers:

1

I have a .net interop project that uses an app.config file. When I am running the VB6 project that is using the interop control in Debug mode, the ConfigurationManager cannot find the app.config file. When I make the VB6 project into an exe and rename the app.config file to (VB6 binary name).exe.config, the ConfigurationManager can find the file.

Is there a way to rename the app.config file or change a setting so ConfigurationManager can find the app.config file while VB6 is running in debug mode?

+8  A: 

A dirty hack is to place the app.config file into the VB6 folder and rename it to vb6.exe.config

Alexander Kojevnikov
That only works when I make the exe, not while I am debugging it
Maudite
Do you rename it to <your application>.exe.config? What I mean is you need to put it to "C:\Program Files\Microsoft Visual Studio\VB98\VB6.EXE.config". VB6 is the host process when debugging, that trick should work (you will probably need to reload VB6 though)
Alexander Kojevnikov
@Alexander Kojevnikov I am checking that right now.
Maudite
@Alexander Kojevnikov That worked. I am sorry I doubted you. I didn't know about the VB6.exe. Thank you.
Maudite