views:

1823

answers:

2

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.

+1  A: 

.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

Mitch Wheat
A: 

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

Alberto VI