Matteo
Matteo

Reputation: 185

ASP.NET MVC project no longer loads after updating package for Microsoft.AspNet.WebApi

Just a few days ago Microsoft released an update for the Microsoft.AspNet.WebApi package (version 5.3.0). I updated my packages through nuget and updated my ASP.NET MVC project going from 5.2.9 to 5.3.0.

After doing so, my project just straight up doesn't work. Once the project finishes building and opens up my web browser it just displays an error 500 directly (This page isn't working at the moment). No errors listed in Visual Studio or any indication in the output as to what just happened. I don't seem to reach the application_start as well so can't do any debugging.

One thing I could find was a warning from the browser dev tools console when the error 500 displays, but can't really relate it to the issue I have with the updated packages

crbug/1173575, non-JS module files deprecated.
(anonymous) @ (index):6587

If you have ideas on what else I could check, please share. Thanks

--

Btw if its any help, the update package and its dependencies are as follows:

Upvotes: 1

Views: 1287

Answers (2)

Luke William Smith
Luke William Smith

Reputation: 1

Almost certainly something to do with the binding redirects. Since the auto-generated ones aren't copied to the Web.config, you can add the below section:

<configuration>
    ....
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <linkedConfiguration href="file:{AssemblyName}.dll.config"/>
    </assemblyBinding>
    ....
</configuration>

Being sure to replace {AssemblyName} with your assembly. Also remove any existing binding redirects from your Web.config.

Upvotes: 0

Kees-Jan Caron
Kees-Jan Caron

Reputation: 11

Maybe check your Web.config. Also, when you try to reinstall the older version: I just updated MicroSoft.AspNet.Mvc from 5.2.9 to 5.3.0. Changes I got in the Web.config:

<runtime>
   <assemblyBinding>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
        <bindingRedirect oldVersion="0.0.0.0-5.3.0.0" newVersion="5.3.0.0"/>
      </dependentAssembly>
   </assemblyBinding>
</runtime>

Upvotes: 1

Related Questions