Is there a maximum size for application settings?

Viewed 6647

Background: I had a large xml string in a Setting and it failed to deserialize. The XmlSerializer complained it was not valid xml. When looking at the string in Project > Settings it looked truncated.

I googled for if there is a limit in size for application settings but did not find anything.

Then I tried to reproduce it using dummydata generated with the following code:

[Test]
public void DumpDummyData()
{
    int n = 500;
    var s = new string('a', 100);
    using (FileStream stream = File.OpenWrite(@"C:\Temp\"+n+".txt"))
    {
        using (var writer = new StreamWriter(stream))
        {

            for (int i = 0; i < n; i++)
            {
                writer.WriteLine( i +" " +s);
            }
        }
    }
}

The string is truncated at row 310 when pasting the contents of the file in a setting. Tried it in two different projects.

My question is what is the limit for app settings size?

2 Answers
Related