Reading web.config with WebConfigurationManager that contains custom sections, can't load
<p>I'm trying to put together a small helper tool to encrypt web.config files. </p>

<p>Linqpad example:</p>

<pre><code>var path = @"F:\project\";

var wcfm = new WebConfigurationFileMap();
wcfm.VirtualDirectories.Add("/",new VirtualDirectoryMapping(path,true));

var config = Configuration.WebConfigurationManager.OpenMappedWebConfiguration(wcfm,"/");

var c = config.Sections["customGroup"];

c.SectionInformation.ProtectSection(null);
config.Save();
</code></pre>

<p>This throws the exception:</p>

<pre><code>Could not load file or assembly 'customGroupAssembly' or one of its dependencies. 
The system cannot find the file specified
</code></pre>

<p>Adding the assembly to LinqPad fixes the errpr. I would assume this is because it's now a compile time reference.</p>

<p>Moving the code to a winforms application, reintroduces the issue. </p>

<p>I'm trying to load the needed assembly at runtime with this:</p>

<pre><code>if (this.openFileDialog1.ShowDialog() == DialogResult.OK)
{
    byte[] assemblyBuffer = File.ReadAllBytes(this.openFileDialog1.FileName);
    AppDomain.CurrentDomain.Load(assemblyBuffer);
    MessageBox.Show("Assembly loaded!");
}
</code></pre>

<p>However it still doesn't seem to find the file.</p>

<p>Is there a way to load the custom assembly into the runtime app domain so that the web config can be loaded properly?</p>
