2015-11-05 65 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,然后尝试重新编译。这应该有希望解决您的问题。

这应该是你需要的软件包。

相关问题