title: AssemblyResolve fired for plugin's resources file
body: <p>My application has an interface IProgressUIPlugin defined in project ProjectNameLib, and the interface is implemented in another DLL.  My main application directly references ProjectNameLib and loads the interface implementation's assembly from the /plugins/ folder when it starts up.  The interfaces have been copy and pasted, with comments and redundant methods stripped, below:</p>
  
  <pre><code>public interface IProgressUIPlugin : IApplicationNameExtension
  {
     IProgressUIWindow CreateNew();
  }
  
  public interface IProgressUIWindow : IDisposable
  {
     void Close();
     void Update(string title, string subtitle, string status, double progress);
  }
  </code></pre>
  
  <p>The interface implementation is implemented in two pieces:</p>
  
  <ol>
  <li>ProjectName.Plugins.BasicProgressUI - implements IProgressUIPlugin, IProgressUIWindow</li>
  <li>ProjectName.Plugins.BasicProgressUI.Blend - Actual WPF view and viewmodel</li>
  </ol>
  
  <p>The DLL implementing the interface is properly loaded so that I am able to invoke the method <code>pluginInstance.CreateNew()</code>.  However, my assembly resolver then tries to resolve.  </p>
  
  <pre><code>ProjectName.Plugins.BasicProgressUI.Blend.resources, Version=1.0.0.0, Culture=en-US, PublicKeyToken=null
  ProjectName.Plugins.BasicProgressUI.Blend.resources, Version=1.0.0.0, Culture=en-US, PublicKeyToken=null
  ProjectName.Plugins.BasicProgressUI.Blend.resources, Version=1.0.0.0, Culture=en, PublicKeyToken=null
  ProjectName.Plugins.BasicProgressUI.Blend.resources, Version=1.0.0.0, Culture=en, PublicKeyToken=null
  </code></pre>
  
  <p>Both resolutions fail (my AssemblyResolve event handler searches for the plugin directory, but nothing of that name exists) and my window displays without the styling specified within its resource dictionary.  </p>
  
  <p>Stuff I've tried so far:</p>
  
  <ol>
  <li>Fiddling around with <code>[assembly: NeutralResourcesLanguageAttribute("en-US", UltimateResourceFallbackLocation.MainAssembly)]</code>.  Tried using Satellite, MainAssembly, and not having the Attribute specified.  Satellite causes a throw after the assemblyresolve invocations, MainAssembly causes AssemblyResolve to not be invoked, and not specifying it causes AssemblyResolve to be invoked.</li>
  <li>Explicitly returning the WPF Project assembly when assemblyresolve is asked to resolve the .resources file.</li>
  <li>Lots of googling (queries such as "wpf resources assemblyresolve", "assemblyresolve resourcedictionary", etc).</li>
  </ol>
  
  <p>I'm aware that for this case, I could just hard-code the color values into the WPF Window to fix the problem, but in the future, we'll be having various resources, localization, skinning, etc, so I figured I should just solve the problem now.</p>
  
  <p>I've described the problem as best as I can.  If you have any questions, I'll definitely respond.</p>
  
  <p>Thanks!</p>
  
  <p><strong>Links:</strong><br>
  <a href="https://code.google.com/p/the-dargon-project/source/browse/?name=core-rewrite#hg/source/Projects/Desktop/Plugins/Dargon.Plugins.BasicProgressUI%253Fstate%253Dclosed" rel="nofollow">The plugin implementation can be found here at code.google.com/the-dargon-project/</a><br>
  <a href="https://code.google.com/p/the-dargon-project/source/browse/source/Projects/Desktop/Core/DargonD/AddInManager.cs?name=core-rewrite" rel="nofollow">The addin manager/assembly resolver can be found here at code.google.com/the-dargon-project/</a></p>