Sunday 14 January 2018

asp.net - Could not load file or assembly System.Web.Http.WebHost after published to Azure web site

style="font-weight: bold;">

Answer



I created a web project and it runs well in Visual
studio. However, I got the following error after published it to azurewebsites. What can
cause the issue?





Could not load file or assembly 'System.Web.Http.WebHost,

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)



Description: An unhandled
exception occurred during the execution of
the current web request. Please
review the stack trace for more
information about the error and where it
originated in the code.



Exception Details:
System.IO.FileLoadException: Could not load file or
assembly
'System.Web.Http.WebHost, 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)




Source Error:



An unhandled exception
was generated during the execution of the
current web request. Information
regarding the origin and location of
the exception can be identified using
the exception stack trace below.



Assembly Load
Trace: The following information can be helpful to
determine why the assembly
'System.Web.Http.WebHost, Version=5.0.0.0,

Culture=neutral,
PublicKeyToken=31bf3856ad364e35' could not be loaded.




WRN: Assembly binding logging is turned OFF. To enable assembly bind

failure logging, set the registry value

[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There
is some
performance penalty associated with assembly bind failure
logging. To turn
this feature off, remove the registry value

[HKLM\Software\Microsoft\Fusion!EnableLog].





The
following is part of web.config file.



 


targetFramework="4.5" />
/>

loginUrl="~/Account/Login" timeout="2880" />









namespace="System.Web.Mvc.Ajax" />
/>

namespace="System.Web.Routing" />
/>






validateIntegratedModeConfiguration="false" />



name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
name="ExtensionlessUrlHandler-Integrated-4.0" />
name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*."
verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule"
scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll"
preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0"
/>
verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule"
scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll"
preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0"
/>
verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS"
type="System.Web.Handlers.TransferRequestHandler"
preCondition="integratedMode,runtimeVersionv4.0" />








publicKeyToken="2780ccd10d57b246" />
oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />




/>
/>




publicKeyToken="31bf3856ad364e35" />
oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />




/>
/>




name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />








/>



publicKeyToken="b77a5c561934e089" culture="neutral" />
oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />






No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...