By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,538 Members | 875 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,538 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
it... Any help woudl be really appreciated!

Thanks a lot in advance,

Pieter
Dec 8 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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\MyApplication\"
- I open the file MyApplication.exe.config with Notepad, and I change the
connectionstring
- I close the Myapplication.exe.config, and start Myapplication.exe
-> 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.settings re-create it automaticly..

This is my application.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings"
type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="MyApplication.Settings"
type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089"
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<connectionStrings>
<add name="MyApplication.Settings.MainConnectionString"
connectionString="Data Source=MyServer;Initial Catalog=MyDataBase;Integrated
Security=True" />
</connectionStrings>
<system.diagnostics>
<sources>
<!-- This section defines the logging configuration for
My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog"/>
<!-- Uncomment the below section to write to the
Application Event Log -->
<!--<add name="EventLog"/>-->
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information" />
</switches>
<sharedListeners>
<add name="FileLog"
type="Microsoft.VisualBasic.Logging.FileLogTraceLi stener,
Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
initializeData="FileLogWriter"/>
<!-- Uncomment the below section and replace APPLICATION_NAME
with the name of your application to write to the Application Event Log -->
<!--<add name="EventLog"
type="System.Diagnostics.EventLogTraceListener"
initializeData="APPLICATION_NAME"/> -->
</sharedListeners>
</system.diagnostics>
<userSettings>
<MyApplication.Settings>
<setting name="LastClientID" serializeAs="String">
<value>0</value>
</setting>
</MyApplication.Settings>
</userSettings>
</configuration>

"Bajoo" <Na**********@gmail.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.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 discussion thread is closed

Replies have been disabled for this discussion.