Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Pro Visual Basic 2005
|
Pro Visual Basic 2005 For advanced Visual Basic coders working in version 2005. Beginning-level questions will be redirected to other forums, including Beginning VB 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro Visual Basic 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 30th, 2008, 11:35 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default Application Settings Editing / Use

I’m trying to get an understanding on the use of app.config.

I created a setting using the normal machinery for that ([u]P</u>roject|projName[u]P</u>roperties...|Settings...). Then I looked in app.config, and there it was. All as expected.

It added:
Code:
    <applicationSettings>
        <projName.My.MySettings>
            <setting name="SavePath" serializeAs="String">
                <value>F:\inetpub\IDDS_Logging\DFC\</value>
            </setting>
        </<projName.My.MySettings>
    </applicationSettings>
    Then I edited app.config with an additional setting. But in the IDE, intelliSense provides the setting added through the grid, but not the one added directly.

So then I found in Settings.Designer.vb the following:
Code:
        <Global.System.Configuration.ApplicationScopedSettingAttribute(),  _
         Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         Global.System.Configuration.DefaultSettingValueAttribute( _
                                           "F:\inetpub\IDDS_Logging\DFC\")>  _
        Public ReadOnly Property SavePath() As String
            Get
                Return CType(Me("SavePath"),String)
            End Get
        End Property
        Also, in Settings.Settings there is;
Code:
  <Settings>
Code:
    <Setting Name="SavePath" Type="System.String" Scope="Application">
      <Value Profile="(Default)">F:\inetpub\IDDS_Logging\DFC\</Value>
    </Setting>
  </Settings>
  But my concern is this: Is the property in Settings.Designer.vb there only to facilitate code writing? If I change the value in app.config manually (through NotePad, for instnce), will the app use the new value? Or is it required tht that setting be maintained through .NET code in the app that uses that particular app.config file?
 
Old April 30th, 2008, 04:03 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Have you tried changing it in the config file and seeing if it changed at runtime?

I am fairly confident that the value will get picked up from the config file at runtime. I think that's the model for the "settings" functionality.

-Peter
peterlanoie.blog





Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Settings.settings when assembly is in GAC evandro.paula .NET Framework 2.0 0 September 25th, 2007 09:54 AM
application settings, data sources and wizards jbenckert Visual Studio 2005 2 March 27th, 2006 05:21 AM
Printer Settings melvik C# 0 May 25th, 2004 02:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.