all groups > dotnet framework > december 2003 >
You're in the

dotnet framework

group:

Installer classes and config files?


Installer classes and config files? Bob Willer
12/30/2003 7:54:51 PM
dotnet framework:
I have a .NET Installer class that gets executed during my installation.
However, that installer class is reliant on an associated .config file. So I
have "MyClass.dll" that is a .NET Installer class. I also have a file
"MyClass.dll.config" that is deployed into the same destination directory.

By doing some testing and using reflection, I have confirmed that the
ExecutingAssembly is "MyClass.dll", and it is executing in the directory
where MyClass.dll.config lives. However, anytime I try to retrieve a value
from the config file, (for example using ConfigurationSettings.AppSettings),
I get an error telling me the section does not exist.

Does anybody have this working, or know of any issues or how to do this?

Thanks,
Bob


Re: Installer classes and config files? Bob Willer
12/31/2003 7:33:50 AM
Thanks Jan. Unfortunately, in this case it is an InstallShield .exe that
launches the .NET Installer class. Using
System.Reflection.Assembly.GetExecutingAssembly() returns me "MyClass.dll".
Any other thoughts?

BW


[quoted text, click to view]

Re: Installer classes and config files? Jan Tielens
12/31/2003 8:51:07 AM
By default the config file of the executing assembly is used, also if a
dependent assemblie requests config file info. So lets say you have an exe
(app.exe) that uses a dll (lib.dll), you should have only 1 config file:
app.exe.config. Even if you want to retrieve settings from whitin the
lib.dll, the .NET Framework will look in the app.exe.config file (=executing
assembly).

--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"Bob Willer" <bobw@nospam.liquidmatrix.com> schreef in bericht
news:%23ep60izzDHA.2872@TK2MSFTNGP09.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button