VB 2010 - Create Custom Configuration Section Using ConfigurationSection


I am trying to create custom section in app.connfig file of my Windows Form application following instructions on this page:


but don't know how to do it.

I would like to have this in final:

      <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client" />

Open in new window

Until now I have this code:

Imports System.Configuration

Namespace TestSection
    Class CustomConfigSection
        Inherits ConfigurationSection

        ' Create a "productId" element.
        <ConfigurationProperty("productId")> _
        Public Property ProductID() As String
                Return Me("productId")
            End Get
            Set(ByVal value As String)
                Me("productId") = value
            End Set
        End Property
    End Class
End Namespace

Open in new window

How can I store a value to key "ProductID" and save to app.config file?

I know, there are other possibilities how to store user settings, but I would like to store it in my custom section.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Éric MoreauSenior .Net ConsultantCommented:
skdanAuthor Commented:
Yes, but I would like to create section, which is not a part of Users Settings section.
Éric MoreauSenior .Net ConsultantCommented:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
skdanAuthor Commented:
I will study this tutorial. I think, this is exactly what I need. Thank you very much.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.