c# - Deploying in azure error Could not resolve this reference. Could not locate the assembly System.Web.Http, Version=4.0.0.0 -
i'm trying deploy website in azure, have error:
d:\windows\microsoft.net\framework\v4.0.30319\microsoft.common.targets(1605,5): warning msb3245: not resolve reference. not locate assembly "system.web.http, version=4.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35, processorarchitecture=msil". check make sure assembly exists on disk. if reference required code, may compilation errors. [d:\home\site\repository\src\presentation\nop.web.framework\nop.web.framework.csproj] mvc\api\authorizeapiattribute.cs(13,53): error cs0234: type or namespace name 'http' not exist in namespace 'system.web' (are missing assembly reference?)
i checked , 'copy local' option activated in solution. idea what's problem?
check web.config
, make sure loading correct versions , make sure referencing system.net.http.dll
in .net 4.0 or nuget microsoft.aspnet.webapi.core
. version use must match have in web.config
.
e.g. nuget microsoft.aspnet.webapi.core 5.2.3
might have system.web.http
like:
<runtime> <assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentassembly> <assemblyidentity name="system.web.http" publickeytoken="31bf3856ad364e35" culture="neutral" /> <bindingredirect oldversion="0.0.0.0-5.2.3.0" newversion="5.2.3.0" /> </dependentassembly> </assemblybinding> </runtime>