views:

157

answers:

2

I'm working on this ComVisible class library that uses a third party component.This component needs some settings to be added to the config file.Since the application that uses my dll is a VB 6 application I don't know where should I put the config file? is there anyway that we can load a config file at runtime?

+1  A: 

You can put the app.config in the same directory as the VB6 app (named (yourapp).exe.config). If you want to load it at runtime, you'll have to write an unmanaged shim that starts the CLR and loads your managed code in a new appdomain- then you can tell it to load whatever config file you want for the new appdomain. This is a pain though (having done it a few times)... There are some options for managed shims as well (see the AppDomainManager class for details).

nitzmahone
A: 

If you just need "a config file" and not specifically the app.config, this post shows a simple class model that I use to store configuration values:

http://stackoverflow.com/questions/1583673/net-suggestions-on-making-a-config-file-for-a-program/1583684#1583684

Ron

Ron Savage
unfortunately I have to use app.config :(
Beatles1692