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

后端 未结 15 1758
半阙折子戏
半阙折子戏 2020-12-07 10:39

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?

15条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-07 11:26

    I had the same problem in my Application.

    System.web.http.webhost not found.
    

    You just need to copy the system.web.http.webhost file from your main project which you run in Visual Studio and paste it into your published project bin directory.

    After this it may show the same error but the directory name is changed it may be system.web.http. Follow same procedure as above. It will work after all the files are uploaded. This due to the nuget package in Visual Studio they download from the internet but on server it not able to download it.

    You can find this file in your project bin directory.

提交回复
热议问题