
Best way to have config file for Assembly?
I am using library specific confguration files, by checking the in-file in
the GAC directory for the location from where the assembly was registered.
That's the only approach I found to work for assemblies in the GAC.
Let me know if you need a code example.
HTH,
Christoph Schittko
Quote:
> Hi,
> I'm trying to come up with a solution to have a configuration file for an
> Assembly.
> I know hoge.dll.config doesn't work like it does for .exe file. When I try
> to use
> Assembly.ExecutingAssembly().Location and if the Assembly is registered in
> GAC,
> it returns something like C:\winnt\assembly\hoge\23009_9879\hoge.dll,
which
> is not
> acceptable. I tried CodeBase property, but result is still the same.
> I guess if the Assembly is not registered in GAC, it will return the
correct
> path to the Assembly.
> What would be the best practice? Should the host app pass the path to the
> configuration
> file I created? I know it may work, but I don't really like the solution
> because I want Assembly
> itself to know where the configuration file is without hardcoding.
> Any help is appreciated.