Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 无法加载文件或程序集';System.Net.Http,版本=4.1.0.0.Net framework 4.6.Net标准1.3_C#_.net_.net Core - Fatal编程技术网

C# 无法加载文件或程序集';System.Net.Http,版本=4.1.0.0.Net framework 4.6.Net标准1.3

C# 无法加载文件或程序集';System.Net.Http,版本=4.1.0.0.Net framework 4.6.Net标准1.3,c#,.net,.net-core,C#,.net,.net Core,我试图在我的项目中调用Watson对话API。 我有一个.net核心项目(包含IBM.WatsonDeveloperCloud包),我在.csproj文件中将目标框架手动更改为net46和netstarndard1.3。 以下是.csproj文件: <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <VersionPrefix>1.1.0</VersionPrefix> &l

我试图在我的项目中调用Watson对话API。 我有一个.net核心项目(包含IBM.WatsonDeveloperCloud包),我在.csproj文件中将目标框架手动更改为net46和netstarndard1.3。 以下是.csproj文件:

  <Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <VersionPrefix>1.1.0</VersionPrefix>
    <AssemblyName>IBM.WatsonDeveloperCloud.Conversation.v1.Example</AssemblyName>
    <OutputType>Exe</OutputType>
    <PackageId>IBM.WatsonDeveloperCloud.Conversation.v1.Example</PackageId>
    <RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>
    <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
    <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
    <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
    <TargetFrameworks>net46;netstandard1.3</TargetFrameworks>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="IBM.WatsonDeveloperCloud" Version="1.1.0" />
    <PackageReference Include="IBM.WatsonDeveloperCloud.Conversation.v1" Version="1.1.0" />
    <PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
    <PackageReference Include="System.Net.Http" Version="4.1.0" />
  </ItemGroup>

</Project>
解决方案资源管理器在Dependencies->SDK下显示System.Net.Http(4.1.0)


欢迎发表任何评论。

请确保您的Web.config文件中没有任何奇怪的绑定重定向。

您在什么样的项目中使用此库?它是否也安装了
System.Net.Http
?我应该在哪里安装它。System.Net.Http 4.1.0已显示在项目依赖项下SDK下的NETStandard.Library中。我也通过NuGet软件包管理器安装了它,但我仍然收到相同的错误看起来你解决了这个问题?什么地方出了问题?我不知道为什么,但当我从目标框架中删除net46时,它不会出错。
System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Net.Http, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.'