Results 1 to 3 of 3

Thread: [RESOLVED] (2003) App.Config Driving me mad....

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Lancashire UK
    Posts
    375

    Resolved [RESOLVED] (2003) App.Config Driving me mad....

    This should be easy but it's driving me nuts, I can't read from the app.config file. I've created a very basic test project and I keep getting the error Required parameter 'Value' not found.

    It's there I can see it ! In the app.config file, someone put me out of my misery

    My app.config

    vb Code:
    1. <?xml version="1.0" encoding="utf-8" ?>
    2. <configuration>
    3. <appSettings>
    4.     <add key="Test" Value="Hello" />
    5. </appSettings>
    6. </configuration>


    My little program to read it.

    vb Code:
    1. Dim ConfigReader As ConfigurationSettings
    2.  
    3.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    4.         Try
    5.             Label1.Text = ConfigReader.AppSettings.Get("Test")
    6.         Catch ex As Exception
    7.             MessageBox.Show(ex.Message)
    8.         End Try
    9.  
    10.     End Sub
    If my post helps , please feel free to rate it

  2. #2
    Fanatic Member Andy_P's Avatar
    Join Date
    May 2005
    Location
    Dunstable, England
    Posts
    669

    Re: (2003) App.Config Driving me mad....

    In the config file, try spelling Value with a lower-case 'v'.


    i.e.
    Code:
    <add key="Test" value="Hello" />
    Using Windows XP Home sp3
    Mucking around with C# 2008 Express
    while ( this.deadHorse ) { flog( ); }


  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Lancashire UK
    Posts
    375

    Re: (2003) App.Config Driving me mad....

    Excellent, I couldn't see and it was staring me in the face !

    Cheers Andy
    If my post helps , please feel free to rate it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width