title: MVC5 on IIS 7.5 throws an exception: Could not load type HttpRedirect
body: <p>I have MVC5 app deployed fine to local IIS8 (Windows 8) but not working after deployment to Windows Web Server 2008 SP1.</p>
  
  <p>The error I get:</p>
  
  <pre><code>Exception Details: System.Web.HttpException: Could not load type 'HttpRedirect'.
  Stack Trace: 
  [HttpException (0x80004005): Could not load type 'HttpRedirect'.]
     System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +9671464
     System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +38
  
  [ConfigurationErrorsException: Could not load type 'HttpRedirect'.]
     System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +359
     System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, Boolean checkAptcaBit) +19
     System.Web.Configuration.Common.ModulesEntry.SecureGetType(String typeName, String propertyName, ConfigurationElement configElement) +39
     System.Web.Configuration.Common.ModulesEntry..ctor(String name, String typeName, String propertyName, ConfigurationElement configElement) +42
     System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +160
     System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +950
     System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +82
     System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
     System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
     System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296
  [HttpException (0x80004005): Could not load type 'HttpRedirect'.]
     System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9915300
     System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
     System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
  </code></pre>
  
  <p>I went through multiple articles and checked settings on IIS, Reinstalled NET frameworks (4, 4.5, 4.5.1), registered within IIS using: c:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -ir</p>
  
  <p>I tried as well deploying few different test applications using standard ASP.NET website, MVC2/3/4 and 5. All end up with this same error. Win-forms using NET 4 work fine on this server.</p>
  
  <p>What is interesting I cannot find any directly related article on the net to problem with loading 'HttpRedirect' type. There is HttpRedirect role installed on the server.</p>
  
  <p>Not sure what to do next. Fight is going on second day and I am running out of ideas. It is not easy to find detailed requirements for MVC to run on the machine either, or it's just me and Friday :-)</p>
  
  <p>UPDATE:</p>
  
  <p>log from FUSLOGVW</p>
  
  <blockquote>
    <p><strong>* Assembly Binder Log Entry  (27/06/2014 @ 15:20:31) *</strong></p>
    
    <p>The operation was successful. Bind result: hr = 0x0. The operation
    completed successfully.</p>
    
    <p>Assembly manager loaded from: 
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll Running under
    executable  C:\Windows\SysWOW64\inetsrv\w3wp.exe
    --- A detailed error log follows. </p>
    
    <p>=== Pre-bind state information === LOG: DisplayName = System.Web.Http  (Partial) WRN: Partial binding information was supplied for an
    assembly: WRN: Assembly Name: System.Web.Http | Domain ID: 6 WRN: A
    partial bind occurs when only part of the assembly display name is
    provided. WRN: This might result in the binder loading an incorrect
    assembly. WRN: It is recommended to provide a fully specified textual
    identity for the assembly, WRN: that consists of the simple name,
    version, culture, and public key token. WRN: See whitepaper
    <a href="http://go.microsoft.com/fwlink/?LinkId=109270" rel="nofollow">http://go.microsoft.com/fwlink/?LinkId=109270</a> for more information and
    common solutions to this issue. LOG: Appbase =
    file:///D:/sitesource/mysite/CM3Management/ LOG: Initial PrivatePath =
    D:\sitesource\mysite\CM3Management\bin LOG: Dynamic Base =
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET
    Files\cm3management\bf917f7b LOG: Cache Base =
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET
    Files\cm3management\bf917f7b LOG: AppName = 871e80 Calling assembly :
    (Unknown).
    === LOG: This bind starts in default load context. LOG: Using application configuration file:
    D:\sitesource\mysite\CM3Management\web.config LOG: Using host
    configuration file:
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet.config LOG: Using
    machine configuration file from
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
    LOG: Policy not being applied to reference at this time (private,
    custom, partial, or location-based assembly bind). LOG: Attempting
    download of new URL
    file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary
    ASP.NET Files/cm3management/bf917f7b/871e80/System.Web.Http.DLL. LOG:
    Attempting download of new URL
    file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary
    ASP.NET
    Files/cm3management/bf917f7b/871e80/System.Web.Http/System.Web.Http.DLL.
    LOG: Attempting download of new URL
    file:///D:/sitesource/mysite/CM3Management/bin/System.Web.Http.DLL.
    LOG: Assembly download was successful. Attempting setup of file:
    D:\sitesource\mysite\CM3Management\bin\System.Web.Http.dll LOG:
    Entering download cache setup phase. LOG: Assembly Name is:
    System.Web.Http, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=31bf3856ad364e35 LOG: A partially-specified assembly
    bind succeeded from the application directory. Need to re-apply
    policy. LOG: Using application configuration file:
    D:\sitesource\mysite\CM3Management\web.config LOG: Using host
    configuration file:
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet.config LOG: Using
    machine configuration file from
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
    LOG: Post-policy reference: System.Web.Http, Version=4.0.0.0,
    Culture=neutral, PublicKeyToken=31bf3856ad364e35 LOG: GAC Lookup was
    unsuccessful. LOG: Binding succeeds. Returns assembly from
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET
    Files\cm3management\bf917f7b\871e80\assembly\dl3\4ba23522\3f728a19_6f7acf01\System.Web.Http.dll.
    LOG: Assembly is loaded in default load context.</p>
  </blockquote>
  
  <p>Similar issue "partially loaded assembly" affects more assemblies that System.Web.Http only in my case. So far all I checked have similar looking log.</p>
  
  <p>I wanted to add as well that I tried publish with "copy local" turned on and then off for System.Web.Http assembly. It makes no difference. Copy local for all assemblies does not help either.</p>