I noticed this interesting behavior today while messing around with the configuration system. When I run this minimal program with no preexisting .config file (use ctrl-F5 to avoid the vshost)...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
namespace PlayinWithConfigurationClasses
{
class Program
{
static void Main(string[] args)
{
Configuration conf = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
conf.Save(ConfigurationSaveMode.Minimal, true);
}
}
}
... I get this saved as the config file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<trust level="Full" />
<webControls clientScriptsLocation="/aspnet_client/{0}/{1}/" />
</system.web>
</configuration>
(I have System.Configuration added as a reference in addition to the "standard" ones.)
Why is the system.web configuration section in there? Whenever I see something peculiar like this it's usually the tip of some interesting iceberg. :) Any ideas what's going on? Just a .NET bug?