title: C#: Could not load types from assembly
body: <p>After adding Lucene.net and Lucene.net Contrib to a C# MVC3, I get the message below after the first successful run. After receiving this error, I need to completely wipe C:\Users\Me\AppData\Local\Temp\Temporary ASP.NET Files before I can run the project again.</p>
  
  <p>I've tried removing the Lucene files manually (including references in my project), and reinstalling them - both with NuGet and manually - but it's always the same situation; after the project has been run once, I start getting the following errors:</p>
  
  <p>Note: Contrib.Regex is part of Lucene.net Contrib.</p>
  
  <pre><code>Server Error in '/' Application.
  
  Could not load types from assembly Contrib.Regex, Version=2.9.4.0, Culture=neutral, PublicKeyToken=85089178b9ac3181, errors:
  Exception: System.IO.FileLoadException: Could not load file or assembly 'Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
  File name: 'Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181'
  
  === Pre-bind state information ===
  LOG: User = rcw7\Me
  LOG: DisplayName = Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181
  (Fully-specified)
  LOG: Appbase = file:///C:/Development/Projects/Foobar/Foobar/
  LOG: Initial PrivatePath = C:\Development\Projects\Foobar\Foobar\bin
  Calling assembly : Contrib.Regex, Version=2.9.4.0, Culture=neutral, PublicKeyToken=85089178b9ac3181.
  ===
  LOG: This bind starts in default load context.
  LOG: Using application configuration file: C:\Development\Projects\Foobar\Foobar\web.config
  LOG: Using host configuration file: C:\Users\Me\Documents\IISExpress\config\aspnet.config
  LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
  LOG: Post-policy reference: Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181
  LOG: Attempting download of new URL file:///C:/Users/Me/AppData/Local/Temp/Temporary ASP.NET Files/root/e9b4cfa4/edfa73f8/Lucene.Net.DLL.
  WRN: Comparing the assembly name resulted in the mismatch: Revision Number
  ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
  Exception: System.IO.FileLoadException: Could not load file or assembly 'Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
  File name: 'Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181'
  </code></pre>
  
  <p>Full output here: <a href="http://pastebin.com/Vbu4VK7B" rel="noreferrer">http://pastebin.com/Vbu4VK7B</a></p>
  
  <p>Initially I thought this was a problem local to my development environment, but after rebuilding and copying the project to our server, I get the same errors.</p>
  
  <p>Any suggestions as how to overcome this? :-)</p>