0

I have an ASP.NET WebAPI 2 application on .net 4.7

I add a Microsoft.Azure.ServiceBus nuget which has dependencies on .NET Standart 2.0

When I run my app locally on IIS Express inside VS2017 everything works fine. When I deploy my app to Azure Web App I receive an error on any REST request

Method not found: 'System.Web.Http.Controllers.HttpRequestContext System.Net.Http.HttpRequestMessageExtensions.GetRequestContext(System.Net.Http.HttpRequestMessage)'

As far as I understand there is different version of System.Web.Http on Azure web app and on my dev machine.

Why this happens and what should I do to fix this?

xakpc
  • 1,709
  • 13
  • 27
  • How did you deploy to Azure ? Did you try to reinstall the nuget `Update-Package Microsoft.AspNet.WebApi -reinstall` . (or) try to `copy file=true` like [here](https://stackoverflow.com/a/38186275/7073340) – Jayendran Sep 14 '18 at 10:07
  • I deploy through Publish command in VS2017. I tried the reinstall, no effect. I will try to set copy local, thx. – xakpc Sep 14 '18 at 10:43
  • Hi @xakz, were you able to fix this issue ? I am also facing the same issue – Kishan Gupta Nov 04 '18 at 12:21

0 Answers0