Monday, February 21, 2011

Write to app.config in .Net 3.5??

I need to be able to write to the app.config file in my .Net 3.5 Windows app to store some system settings?

I can read from the file but I can't write to it??

Everything I have found is for 2.0 and doesn't look to be the same for 3.5.

From stackoverflow
  • .NET 2.0 is part of .NET 3.5

    So just use what you found for .NET 2.0, or have a look at: Read/Write App.config with .NET 2.0

    Also see SO answer: Update app.config system.net setting at runtime

  • How to read a value from app.config appsettings section .NET 3.5?

    app.config ---

    <applicationSettings>
        <x.My.MySettings>
            <setting name="x1" serializeAs="String">
                <value>Apple</value>
            </setting>
            <setting name="x2" serializeAs="String">
                <value>Red</value>
            </setting>
        </x.My.MySettings>
    </applicationSettings>
    

    Look that appsettings have a "setting name ..." not "add ..." Thank's

0 comments:

Post a Comment