473,396 Members | 2,018 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Has anyone used the settings class?

Hi there,
I added a settings component to my .DLL so that I can read in
the configuration settings. This created a DLLNAME.config file in the
output directory and everything seemed to be OK until I tried to deploy the
..DLL and then realised that no matter what I type in the .config file, the
..DLL always returns the default values. The .DLL is going to be called from
a VB Script, so what should I be using for a .config file that can be simply
edited in notepad when it is deployed?
Aug 2 '06 #1
4 1089
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

Waldy wrote:
Hi there,
I added a settings component to my .DLL so that I can read in
the configuration settings. This created a DLLNAME.config file in the
output directory and everything seemed to be OK until I tried to deploy the
.DLL and then realised that no matter what I type in the .config file, the
.DLL always returns the default values. The .DLL is going to be called from
a VB Script, so what should I be using for a .config file that can be simply
edited in notepad when it is deployed?
Aug 3 '06 #2
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.
Aug 3 '06 #3
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.
"Waldy" <so*****@microsoft.comwrote in message
news:e5**************@TK2MSFTNGP04.phx.gbl...
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.

Aug 3 '06 #4
The ApplicationConfiguration classes will always use the default config
file specified in your AppDomain.

AppDomain.CurrentAppDomain.SetupInformation.Config urationFile

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

Waldy wrote:
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.
"Waldy" <so*****@microsoft.comwrote in message
news:e5**************@TK2MSFTNGP04.phx.gbl...
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.
Aug 30 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Danny Lesandrini | last post by:
I'm using an Access database to drive a web site and the colors of various table backgrounds are stored in Access. I want users of the Access database to be able to select colors for the site, but...
10
by: Not Available | last post by:
On the host server: namespace JCart.Common public class JCartConfiguration : IConfigurationSectionHandler private static String dbConnectionString; public static String ConnectionString { get...
2
by: Jim | last post by:
I'm trying to use the Application Settings option in VS2005 with C#. So far I've no success getting my settings to save or load. Various tutorials on the 'net seem to be outdated. Even MSDN's...
9
by: Coleen | last post by:
Hi All :-) I am desperately looking for some help/information on how to direct page flow. Forget what I have done - here's what I need to do: I have a large ASPX.Net - VB.Net web application...
4
by: Richard Lewis Haggard | last post by:
I have an application that can't use the registry to save various user options and application settings. My first thought was to simply use an application configuration file but this approach seems...
13
by: Dave | last post by:
When using the properties designer to store application wide properties how do you get this to work across a project group containing an EXE and a collection of DLLs. I'm using C#.Net 2005. I...
6
by: WT | last post by:
Hello, Using VS2005. I have an assembly library that can be called from a Web site asp.net application or from a winform application. From this library I need to retrieve a path using simply a...
13
by: Anonymous | last post by:
On MS site: http://msdn2.microsoft.com/en-us/library/esew7y1w(VS.80).aspx is the following garbled rambling: "You can avoid exporting classes by defining a DLL that defines a class with...
8
by: Clarks Computing | last post by:
Hi all, Question regarding the settings feature in Visual C# 2008. Let's say I create a user setting called TextEditor in the settings designer. I realize that I can type a string value such...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.