Hi,
I'm not 100% following the question, but here's my shot.
.NET reads the AppConfig once for an AppDomain - then it caches the
values and stops reading them again. So if you modify the config file
halfway don't expect the running application to suddenly be able to see
the new values.
By default, the config file is the name of the starting exe file +
".config" suffix. You can see/change the config file in setting up
your AppDomain. What this does mean though, is if you have two
executables A.exe and B.exe, both using DLLNAME.dll
Then you need by default A.exe.config as well as B.exe.config files.
Not sure if I managed to catch your question - I tried to cast a big
net :)
jliu - johnliu.net
> Hi there,
> I added a settings component to my .DLL so that I can read in
[quoted text clipped - 4 lines]
> a VB Script, so what should I be using for a .config file that can be simply
> edited in notepad when it is deployed?
Waldy - 03 Aug 2006 11:39 GMT
Hi John,
thanks for responding. My issue is that the values in the
.config file are not used, it appears as though the values are compiled into
the .dll. The .dll is instantiated via VB Script, so there is no
application as such.
Waldy - 03 Aug 2006 12:24 GMT
O.K. It's the old application must be an .exe thing. I created copied the
.config file from the output directory to the one where the application
(engine.exe) is that runs the VB Scripts and renamed it to engine.exe.config
and I get my modified settings.
> Hi John,
> thanks for responding. My issue is that the values in the
> .config file are not used, it appears as though the values are compiled
> into the .dll. The .dll is instantiated via VB Script, so there is no
> application as such.
John Liu - 30 Aug 2006 01:51 GMT
The ApplicationConfiguration classes will always use the default config
file specified in your AppDomain.
AppDomain.CurrentAppDomain.SetupInformation.ConfigurationFile
If you want to specify in your own DLL where to retrieve the file, you
might need to create your own AppDomain within the dll, set it up to a
different Config file, then load your ApplicationConfiguration within
that AppDomain.
You'll need to make some cross-domain calls. And it can look hairy...
(Actually I feel itchy thinking down this path already).
May want to re-think how you want to specify your config settings.
jliu
> O.K. It's the old application must be an .exe thing. I created copied the
> .config file from the output directory to the one where the application
[quoted text clipped - 6 lines]
> > into the .dll. The .dll is instantiated via VB Script, so there is no
> > application as such.