Using app.config with Interop Controls

廉价感情. 提交于 2019-11-30 20:56:26

I'm not 100% sure on this. But I'll throw out some possibilities. First of all, app.config is not the correct name for the file. While it is app.config in your project, it gets auto-renamed to binary.exe.config or binary.dll.config (depending on project type) where binary is the name of the project.

Secondly, I'm not 100% sure if dll.config files are always properly loaded and read by .NET when the application loads. I don't believe it happens automatically, and that there is an extra call you have to make to read the config file if its for the dll. If you reneame the config file to match your exe, then it will definitely load and be available to you.

Beth Massi has a blog post that describes how to use a config file for an Interop Control with VB 6.0.

http://blogs.msdn.com/bethmassi/archive/2007/10/24/using-my-settings-and-wcf-configuration-with-the-interop-forms-toolkit.aspx

Two options:

1) Find your vb.exe path and put your config in there, as VB6.exe.config.

2) If you don't need to use the IDE just make your MyApp.exe an put it in your project's folder as MyApp.exe.config, then run the exe and it will find it.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!