[Azure]_解決部屬網站到Azure website後,出現Could not load file or assembly ‘System.Web.Http … The system cannot find the file specified.

今天老闆丟了兩個Azure site的Project給我,本機run都ok…可是WebDeploy到了Azure site就出現:

Could not load file or assembly ‘System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.

 

後來查了一下stackoverflow才發現是refrence預設不會幫你copy帶到project底下,需要手動去設定所有的reference copy local = true才行…

 

可以點選第一項refrence,然後押著shift點擊最後一項refrence做全選,然後屬性的部份把Copy local設為Ture,重新deploy就過了

azuresite

 

 

thx for:

http://stackoverflow.com/questions/20323107/could-not-load-file-or-assembly-system-web-http-webhost-after-published-to-azure

http://stackoverflow.com/questions/26533868/could-not-load-file-or-assembly-system-web-http-webhost-version-4-0-0-0-cultu

Leave a comment

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料