Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring CodeConfig ScanAllAssemblies throws a ReflectionTypeLoadException
    text
    copied!<p>I'm trying out the new Spring CodeConfig for .NET but have tons of trouble with it.</p> <p>I installed the NuGet package <a href="http://nuget.org/List/Packages/Spring.CodeConfig" rel="nofollow">Spring.CodeConfig</a> into an existing .NET 4 project, but have had nothing but trouble with it.</p> <p>The ScanAllAssemblies method throws a ReflectionTypeLoadException when I run this code:</p> <pre><code>var context = new CodeConfigApplicationContext(); context.ScanAllAssemblies(); context.Refresh(); </code></pre> <p>This happens even if I have defined no configuration class, but it also happens if I create a configuration class.</p> <p>The LoaderExceptions property contains a single exception with this message:</p> <blockquote> <p>Could not load file or assembly 'System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. Invalid pointer (Exception from HRESULT: 0x80004003 (E_POINTER))</p> </blockquote> <p>I've tried adding an assembly redirect from version 1.0.3300.0 of System to version 4.0.0.0, which is the one that's referenced in my project, but this doesn't work.</p> <p>How can I resolve this issue?</p> <hr> <p>As requested, here are the references from the project in question:</p> <ul> <li>mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</li> <li>Ploeh.Samples.MenuModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</li> <li>Spring.Aop, Version=1.3.1.40711, Culture=neutral, PublicKeyToken=65e474d141e25e07</li> <li>Spring.Core, Version=1.3.1.20711, Culture=neutral, PublicKeyToken=65e474d141e25e07</li> <li>Spring.Core, Version=1.3.1.40711, Culture=neutral, PublicKeyToken=65e474d141e25e07</li> <li>Spring.Core.Configuration, Version=1.0.0.4111, Culture=neutral, PublicKeyToken=65e474d141e25e07</li> <li>System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</li> <li>System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</li> <li>System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</li> <li>System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</li> <li>xunit, Version=1.7.0.1540, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c</li> </ul> <p>Since the second reference is a project reference, I'm also listing its dependencies:</p> <ul> <li>mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</li> <li>System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</li> </ul> <p>I also have these binding redirects in my App.config - in case it matters:</p> <pre><code>&lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt; &lt;dependentAssembly&gt; &lt;assemblyIdentity name="Spring.Core" publicKeyToken="65e474d141e25e07" culture="neutral" /&gt; &lt;bindingRedirect oldVersion="1.3.1.20711" newVersion="1.3.1.40711" /&gt; &lt;/dependentAssembly&gt; &lt;dependentAssembly&gt; &lt;assemblyIdentity name="System" publicKeyToken="b77a5c561934e089" culture="neutral" /&gt; &lt;bindingRedirect oldVersion="1.0.3300.0" newVersion="4.0.0.0" /&gt; &lt;/dependentAssembly&gt; &lt;/assemblyBinding&gt; </code></pre> <p>However, both were attempts to fix problems with CodeConfig. Removing them doesn't help...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload