Config files
-
I have a .dll with its own config file. This .dll reads from its own config file and not from the app.config (this is what I wanted). However, when I create the installer for the application, the .exe uses the app.config file to read from, but what about the .dll? Where is the config file for the .dll stored? It is getting the values but I am curious where it is getting it from? The app is working fine but I want to change the config file for the .dll but I cannot find it.
CodingYoshi Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
-
I have a .dll with its own config file. This .dll reads from its own config file and not from the app.config (this is what I wanted). However, when I create the installer for the application, the .exe uses the app.config file to read from, but what about the .dll? Where is the config file for the .dll stored? It is getting the values but I am curious where it is getting it from? The app is working fine but I want to change the config file for the .dll but I cannot find it.
CodingYoshi Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
Have you looked for the settings in the apps config file ? If you don't have a config file for the dll ( I always do ), then it's either using defaults, or getting them from the app config.
Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
-
I have a .dll with its own config file. This .dll reads from its own config file and not from the app.config (this is what I wanted). However, when I create the installer for the application, the .exe uses the app.config file to read from, but what about the .dll? Where is the config file for the .dll stored? It is getting the values but I am curious where it is getting it from? The app is working fine but I want to change the config file for the .dll but I cannot find it.
CodingYoshi Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
CodingYoshi wrote:
I have a .dll with its own config file.
No you don't. .DLL's do not use their own config file, even if you put on in the DLL's project. .DLL's are loaded into the processes that call them, inheriting the host process' config file, if there is one. Your code has to be explicitly written to find and load the config file your talking about. Config files are normally stored in the same folder as the .EXE using it.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
CodingYoshi wrote:
I have a .dll with its own config file.
No you don't. .DLL's do not use their own config file, even if you put on in the DLL's project. .DLL's are loaded into the processes that call them, inheriting the host process' config file, if there is one. Your code has to be explicitly written to find and load the config file your talking about. Config files are normally stored in the same folder as the .EXE using it.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008Strange!! Then it should cause an exception since config setting are key value pairs. I have specified the key of the value in .dll code. The only other thing is, tomorrow, I have to reassure and see if a value with the same key exists in the app.config which will explain why no exception is thrown. Otherwise, I don't know. I agree with you, .dlls can have their own config files but they have to be read explicitly and I am reading it explicitly but I will reassure.
CodingYoshi Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
-
CodingYoshi wrote:
I have a .dll with its own config file.
No you don't. .DLL's do not use their own config file, even if you put on in the DLL's project. .DLL's are loaded into the processes that call them, inheriting the host process' config file, if there is one. Your code has to be explicitly written to find and load the config file your talking about. Config files are normally stored in the same folder as the .EXE using it.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008I reassured and the .dll is using its own config file. I am using [NameOfDll].Properties.Settings.Default.[keyOfValue] to access the value from the config file. I changed the config file for the .dll and during runtime it threw exception since it could not find it. So the question is, where is it reading from? I don't see a config file for the .dll on the production machine but all is fine.
CodingYoshi Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07