title: Visual Studio 2013.2 can't build because IIS is locking an assembly
body: <p>My ASP.NET MVC 5 application is using my local IIS (Windows 7) which worked great until I had to start using the Microsoft.SqlServer.Types NuGet package. Because the package has native assemblies they have to be specialty loaded at runtime.</p>
  
  <p>The problem I'm running into though is that after I rebuild the application and access it through the browser IIS loads and locks the native assemblies. If I make the change and rebuild again, Visual Studio fails and says the assemblies are locked by another process, IIS. The only work around I've found is to keep restarting IIS before I build which is unpractical when I may have to rebuild hundreds or thousands of times in a day depending on how many changes I make.</p>
  
  <p>Is there a more proper work around? Like telling Visual Studio not to bother with the native assemblies? Help would be appreciated.</p>
  
  <p>Here's how I'm loading the assemblies:</p>
  
  <pre><code>[assembly: WebActivatorEx.PreApplicationStartMethod(typeof(X.Mvc.App_Start.SqlServerTypesConfiguration), "LoadAssemblies")]
  
  namespace X.Mvc.App_Start {
      public static class SqlServerTypesConfiguration {
          public static void LoadAssemblies() {
              SqlServerTypes.Utilities.LoadNativeAssemblies(System.Web.Hosting.HostingEnvironment.MapPath("~/bin"));
          }
      }
  }
  </code></pre>