Could not load file or assembly ‘System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes’ or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)

今天在Publish 網頁到 Development Server時出現以下的錯誤
Could not load file or assembly ‘System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes’ or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)

這個是ASP.Net MVC 3的網站
Host 在 Windows Server 2008 R2IIS 上 安裝了 .Net Framework 4.0

在加入了AutoMapper 這一個Nuget Package 之後便出現這個問題了

做了一會research 之後終於找到解決方法了

解決方法:
大家可以到 以下網址下載及安裝 .Net 4.5.1或更新的版本..

http://www.microsoft.com/en-gb/download/details.aspx?id=40779

這便可以解決這個問題

Hope you find it useful

Leave a Reply