2015-11-05 57 views
0

應用程序啓動異常:System.IO.FileLoadException:無法加載文件或程序集'testapp,Culture = neutral,PublicKeyToken = null'或其依賴項之一。一般例外(從HRESULT異常:0x80131500如何在Mac機器中的Mvc Project中添加程序集?

文件名: 'testapp,文化=中立,公鑰=空' ---> Microsoft.Dnx.Compilation.CSharp.RoslynCompilationException:/用戶/ brilliomac /桌面/ testapp /Controllers/HomeController.cs(26,48):DNXCore,Version = v5.0錯誤CS1061:'HttpContent'不包含'ReadAsAsync'的定義,也沒有接受類型'HttpContent'的第一個參數的擴展方法'ReadAsAsync'可以找到(是否缺少using指令或程序集引用?)

我從這個link 解決方案,我試圖添加組件的web.config還是我收到同樣的錯誤

我的web.config文件

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
    <system.webServer> 
    <handlers> 
    <add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/> 
    </handlers> 
    <httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false"/> 
    </system.webServer> 
    <system.web> 
    <compilation debug="true" targetFramework="4.0"> 
    <assemblies> 
     <add assembly="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> 
    </assemblies> 
    </compilation> 
    </system.web> 
</configuration> 

試過這也

<system.webServer> 
    <handlers> 
    <add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/> 
    </handlers> 
    <assemblies> 
     <add assembly="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> 
    </assemblies> 
    <httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false"/> 
</system.webServer> 

回答

0

你能確認你正在使用Mac?

我會使用命令dnu install Microsoft.AspNet.WebApi.Client,然後嘗試重新編譯。這應該有希望解決您的問題。

這應該是你需要的軟件包。

相關問題