Assembly Resolve Not Fully Loading My DLL?
<p>I'm using a method to load a dll on an AssemblyResolve event.  It's not quite working the way I want it to.  Here's some code:</p>

<p>in my form load:</p>

<pre><code>var a = AppDomain.CurrentDomain;
a.AssemblyResolve += (object sender, ResolveEventArgs args) =&gt; LoadDLL(sender, args, anArg);
</code></pre>

<p>LoadDLL:</p>

<pre><code>public Assembly LoadDLL(object sender, ResolveEventArgs agrs, bool anArg){
    //Let's just ignore anArg, it doesn't affect anything related to the problem
    asseblyPath = @"XXX";//path to my dll
    return Assembly.LoadFrom(assemblyPath);
}
</code></pre>

<p>So that's all well and good.  I set Copy Local to false for my DLL so the AssemblyResolve event is called and I can load the desired version of my DLL.  </p>

<p>One strange thing that is happening is this: After running this code, my code tries to access a public variable from a class containing global constant values (this class should be in my DLL). </p>

<pre><code>public class GCV{
    public GCV(){}
    public string value1= "asdf";
}
</code></pre>

<p>Unfortunately, when I'm in debug mode, GCV.value1 is set to null when it clearly has a value in the class definition.  This is one symptom that I can describe here, hopefully enough to diagnose the problem?  </p>

<p>Thanks!</p>
