473,385 Members | 1,780 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,385 software developers and data experts.

How to work with My.Settings?

Hi all,

I've a class ("Class1"), with an auto-generated a "Class1.exe.config" for
use with the My.Settings function calls.

If my "Class1" is a window form, everything just works fine, i.e., I could
open up "Class1.exe.config", change some values in it, launch my Class1.exe
and all the changes will be reflected.

However, when I changed my "Class1" to a Class Library, nothing works. It
will now auto-generates a "Class1.dll.config", but whenever I change the
values in the config file and re-launch my application, the changes doesn't
get reflected.

I think it must be some settings in VS2005, but just couldn't seems to
figure out what. Pls advice.

Thanks,
Simon

Feb 23 '06 #1
1 899
Simon,

I don't have 2005 yet and don't know the answer, but my philsophy was that
it's so easy to write my own, and 2003 didn't work like I wanted so I did.

You can get my settings class, which does work at

www.storyitc.com/codesamples

clsPropertyManager (you will need to copy the text to a file with a .vb
extension and add to your project as an existing class.)

The code should be pretty explanatory. Specify the config filepath in the
constructor and true if you want settings read in on the getgo,
then it just uses an item style property to set and get settings. It could
be easily expanded to support groups of settings if you wanted to.

MS may have better with 2005, but if not, you at least know how this works
and have the code.

HTH,

Shane

"Simon Says" <si******@gmail.com> wrote in message
news:ur**************@TK2MSFTNGP11.phx.gbl...
Hi all,

I've a class ("Class1"), with an auto-generated a "Class1.exe.config" for
use with the My.Settings function calls.

If my "Class1" is a window form, everything just works fine, i.e., I could
open up "Class1.exe.config", change some values in it, launch my
Class1.exe and all the changes will be reflected.

However, when I changed my "Class1" to a Class Library, nothing works. It
will now auto-generates a "Class1.dll.config", but whenever I change the
values in the config file and re-launch my application, the changes
doesn't get reflected.

I think it must be some settings in VS2005, but just couldn't seems to
figure out what. Pls advice.

Thanks,
Simon

Feb 25 '06 #2

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

Similar topics

1
by: Dathon | last post by:
I am trying to recursively enumerate the contents of my Documents and Settings folder. While doing this, I cam across the following: C:\Documents and Settings\All Users\Application...
1
by: Henry Reardon | last post by:
I have been having problems with the Development Center for several days now. It seemed to be working fine when I initially installed DB2 (LUW) Version 8 (FP7) and upgraded to FP8, except that I...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
5
by: Mountain | last post by:
In the following MSDN documentation: http://msdn2.microsoft.com/en-us/library/system.configuration.applicationsettingsbase(VS.80).aspx there is an example of using ApplicationSettingsBase. I...
16
by: Robert Dufour | last post by:
Here's the class code snippet Imports System.Configuration.ConfigurationManager Public Class Class1 Public _strTestSetting As String Public Sub SetTestsetting()
0
by: =?Utf-8?B?UmljayBHbG9z?= | last post by:
For some unknown reason (user error?), I cannot get a NameValueCollection to persist in the app.config file. Unlike other settings, I cannot get the String Collection Editor GUI to allow my to...
3
by: hscott93 | last post by:
Hello. I have a new Vista based laptop at work that connects to a Windows 2003 Small Business Server at work via an assigned, static IP address. When I take the laptop home, I have router that...
5
by: jheines | last post by:
I am trying to explain how cookies and sessions work in a class I teach, but I have hit a wall when it comes to the interaction between cookies and the state of the privacy settings in Internet...
7
by: Just_a_fan | last post by:
I save some data to an array in my program. I can reopen the setting screen and see that the data is, in fact, in the array. I then do a lot of these: My.Settings.Brkr1 = BreakerAmps(1)...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.