35291

Azure webrole cycling and “Could not load file or assembly System.Web.Http 5.2.0.0”

Question:

I can't deploy my azure webrole anymore, it's cycling indefinitly. So I put on Intellitrace and I found this exception :

<blockquote>

Exception:Thrown: "Unable to load the role entry point due to the following exceptions: -- System.IO.FileLoadException: Could not load file or assembly 'System.Web.Http, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

</blockquote>

In my project, web.config and package (Webapi, webhost etc.) are all in 5.2.0.0 so I don't understand why Azure try to find 5.0.0.0 ?!

Example:

<dependentAssembly> <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.2.0.0" /> </dependentAssembly>

Do you have any idea ? Thanks

ps: System.Web.Http got copy local:true

Answer1:

That intellitrace output is telling you that WaIISHost.exe is crashing ("Unable to load the role entry point"). But your web.config assembly binding redirect is only affecting the w3wp.exe process. You have a couple options:

<ol><li>Check your role entry point (the class that derives from RoleEntryPoint, typically WebRole.cs) to make sure you are referencing System.Web 5.2 DLLs.</li> <li>Create a .config file with your binding redirect for the WaIISHost process. To do this you would create a .dll.config. In a default web role project this would be WebRole1.dll.config.</li> </ol>

Recommend

  • populate dropdown is not working
  • Dojo - how to submit data using a Dialog form
  • How can retrieve string formData js in c#
  • Rotativa component throws error Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.
  • CRM - sending email to contacts in sub grid
  • ASP.NET MVC 4 Beta Breaks Developer Preview Projects
  • Json.Encode working in CS file but not in CSHTML
  • Use VBA to click on a button in IE
  • using rich textbox in Sharepoint 2013
  • Azure Functions 1.0.7 giving Could not load file or assembly error with EF Core 2
  • Azure Function exception could not load ActiveDirectory file or assembly
  • Another assembly referencing the old dll
  • Localization using resources file not working
  • Azure Bot Framework Emulator Error - System.ArgumentNullException: Value cannot be null
  • Target the XNA framework in ordinary Visual Studio 2012 project
  • Nuget Assembly reference Microsoft Owin after upgrade to 3.0.1
  • Using curl with Phalanger
  • VS2013 Build Definition 'Microsoft.TeamFoundation.Client.BasicAuthCredential' is not marke
  • Robotium & system dialogs
  • TryParse double values
  • Entity Framework on SQL Server CE without driver install
  • Gephi's java default method not implemented in C# with an ikvm-from dll library
  • Show no record found using tablesorter search widget
  • How does the scala compiler locate the positions for variance annotation
  • Activation error occured while trying to get instance of type LogWriter, key “”
  • How to modify the HTML tag in Drupal 6?
  • integrate POCO library in android ndk
  • How to load Q library with Require.js?
  • Unzip archive in .Net CORE 1.0
  • Servlet stops working on Tomcat server after some hits or time
  • Best way to dynamically load an xml configuration file into a Flex4/Flash movie at runtime?
  • Web.config system.webserver errors
  • Unable to install Git-core+svn by MacPorts
  • How do I exclude a dependency in provided scope when running in Maven test scope?
  • MVC3 Razor - ListBox pre-select not working
  • Reading JSON from a file using C++ REST SDK (Casablanca)
  • FB SDK and cURL: Unknown SSL protocol error in connection to graph.facebook.com:443
  • Warning: Can't call setState (or forceUpdate) on an unmounted component
  • Is there a mandatory requirement to switch app.yaml?
  • bootstrap to use multiple ng-app
  • How to get icons for entities from eclipse?
  • C# - Getting references of reference
  • Turn off referential integrity in Derby? is it possible?
  • JaxB to read class hierarchy
  • UserPrincipal.Current returns apppool on IIS