473,748 Members | 7,118 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

App.Config change doesn't affect My.Settings?

Hi,

I'm using the Settings.settin gs of VB.NET to define a Connectionstrin g
(Scope = application). When I deploy the Solution, and change this Setting
in the app.config-file, it seems that itdoesn't affect the Application at
all! It still uses the old value. Are the Settings.Settin g hardcoded
somewhere
in the application?

I can't find any documentation of this subject, or anyway how I should do
it... Any help woudl be really appreciated!

Thanks a lot in advance,

Pieter
Dec 8 '05 #1
2 2224
Dear Pieter,
Are you changing the Values after application starts?
cause this wont change until the app restarts. and can you please show
the code you are using to change the App.Config

Regards,
Naveed Ahmad Bajwa
http://bajoo.blogspot.com/

Dec 8 '05 #2
Hi,

I'm jsut changing the App.Config with notepad (not in the application but
manually.

These are the steps:
- I install the application
- I go the the folder (C:\Program Files\MyApplica tion\"
- I open the file MyApplication.e xe.config with Notepad, and I change the
connectionstrin g
- I close the Myapplication.e xe.config, and start Myapplication.e xe
-> it still takes the old value (which isn't anymorei n the App.config...)

I didn't create the App.config or didn't change anything in it. when I
delete it the Settings.settin gs re-create it automaticly..

This is my application.con fig:

<?xml version="1.0" encoding="utf-8" ?>
<configuratio n>
<configSections >
<sectionGroup name="userSetti ngs"
type="System.Co nfiguration.Use rSettingsGroup, System, Version=2.0.0.0 ,
Culture=neutral , PublicKeyToken= b77a5c561934e08 9" >
<section name="MyApplica tion.Settings"
type="System.Co nfiguration.Cli entSettingsSect ion, System, Version=2.0.0.0 ,
Culture=neutral , PublicKeyToken= b77a5c561934e08 9"
allowExeDefinit ion="MachineToL ocalUser" requirePermissi on="false" />
</sectionGroup>
</configSections>
<connectionStri ngs>
<add name="MyApplica tion.Settings.M ainConnectionSt ring"
connectionStrin g="Data Source=MyServer ;Initial Catalog=MyDataB ase;Integrated
Security=True" />
</connectionStrin gs>
<system.diagnos tics>
<sources>
<!-- This section defines the logging configuration for
My.Application. Log -->
<source name="DefaultSo urce" switchName="Def aultSwitch">
<listeners>
<add name="FileLog"/>
<!-- Uncomment the below section to write to the
Application Event Log -->
<!--<add name="EventLog"/>-->
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSw itch" value="Informat ion" />
</switches>
<sharedListener s>
<add name="FileLog"
type="Microsoft .VisualBasic.Lo gging.FileLogTr aceListener,
Microsoft.Visua lBasic, Version=8.0.0.0 , Culture=neutral ,
PublicKeyToken= b03f5f7f11d50a3 a, processorArchit ecture=MSIL"
initializeData= "FileLogWri ter"/>
<!-- Uncomment the below section and replace APPLICATION_NAM E
with the name of your application to write to the Application Event Log -->
<!--<add name="EventLog"
type="System.Di agnostics.Event LogTraceListene r"
initializeData= "APPLICATION_NA ME"/> -->
</sharedListeners >
</system.diagnost ics>
<userSettings >
<MyApplication. Settings>
<setting name="LastClien tID" serializeAs="St ring">
<value>0</value>
</setting>
</MyApplication.S ettings>
</userSettings>
</configuration>

"Bajoo" <Na**********@g mail.com> wrote in message
news:11******** *************@g 43g2000cwa.goog legroups.com...
Dear Pieter,
Are you changing the Values after application starts?
cause this wont change until the app restarts. and can you please show
the code you are using to change the App.Config

Regards,
Naveed Ahmad Bajwa
http://bajoo.blogspot.com/

Dec 8 '05 #3

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

Similar topics

16
4206
by: DraguVaso | last post by:
Hi, I have a Windows Service running (made in VB.NET), and wanted to be able to change from time to time some parameters by changing them in the App.config. But it seems that the application doesn't use the changed values in the App.config, but continue to use the values that were there during start-up. Is there a way to let the application use the new values in the App.config? Is there kind of some 'refresh' function that I should...
9
8277
by: ALI-R | last post by:
Hi,, I have two questions : 1) Is it mandatory that config file of a desktop application must be App.config 2) Is it possible to update config file in your code?? thanks for your help. ALI
4
2034
by: Dominic | last post by:
Suppose I have a web.config. I'd like to move some configuration settings from this web.config and put it another XML file (say, common.xml). Now, is there any way that I can modify the web.config such that it will include (dynamically) the common.xml? In other words, System.Configuration.ConfigurationSettings.GetConfig can read settings in common.xml as they were in web.config. Furthermore, when I load web.config into XML DOM object,...
2
2670
by: Pieter | last post by:
Hi, I'm using the Settings.settings of VB.NET to define a Connectionstring (Scope = application). When I deploy the Solution, and change this Setting in the app.config-file, it seems that itdoesn't affect the Application at all! It still uses the old value. Are the Settings.Setting hardcoded somewhere in the application? I can't find any documentation of this subject, or anyway how I should do
17
3248
by: Fred Nelson | last post by:
Hi: I have written several web applications that obtain their connection strings from the web.config file. This is very easy to use and it makes it easy to move an app from development into production. I'm in the process of writing a site that will have lots of traffic so I'm trying to save resources everyplace that I can. My question is - do the web.config app settings get loaded once when the
13
5371
by: Jonny Bergdahl | last post by:
I have a ASP.Net 2.0 web application that I am trying to debug. Problem is that I can't get the error message to show in the browser. It always returns the generic error message telling me to set customErrors="Off". Problem is I have already done that. I have tried to activate tracing as well, by setting trace enabled="true", but accessing the trace.axd page returns a message instructing me to do just that. I have tried to figure out...
5
7864
by: mmcd79 | last post by:
I built a VB.net application that makes use of a machine level DB connection string setting, and a user level starting location setting. The machine level setting and the default user based setting is of course stored in the app.exe.config file located in the same directory as the exe. Upon closing the form, I save the user setting which then creates a user.config file in the appdata directory in my profile. This is all well and good....
10
1664
by: =?Utf-8?B?TUNN?= | last post by:
When creating a new VB Web Application Project with VS2008, there are several settings (compiler settings, option strict, etc) that appear both in the web.config file and "My Project". I'm wondering what takes precedent, what the benefit of using one vs. the other is, and what happens if they conflict?
8
16095
by: Andrus | last post by:
..NET 2 Winforms application. How to create new setting and set it default value in userSettings section of app.config file or overwrite existing setting value ? I found code below in this list which modifies Application setting section but how to add new item to userSettings ? Andrus.
0
8984
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9363
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9312
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9238
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8237
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2206
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.