如何调试VB6的项目中,有一个.NET互操作的项目,它使用一个app.config文件?项目、有一个、操作、文件

2023-09-03 16:22:34 作者:残念

我有一个使用一个app.config文件.NET互操作的项目。当我运行一个使用在调试模式下的互操作控制VB6的项目,ConfigurationManager中找不到app.config文件。当我做了VB6项目进入了一个exe和重命名的app.config文件(VB6的可执行文件名).exe.config,ConfigurationManager中可以找到该文件。

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.

有没有办法来重命名app.config文件或更改设置,以便ConfigurationManager中可以在VB6在调试模式下运行找到app.config文件?

推荐答案

一个肮脏的黑客是app.config文件放入文件夹,VB6,并改名为vb6.exe.config

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