简体   繁体   English

无法加载文件或程序集'System.Net.Http,Version = 4.1.0.0 .net framework 4.6 .net standard 1.3

[英]Could not load file or assembly 'System.Net.Http, Version=4.1.0.0 .net framework 4.6 .net standard 1.3

I'm trying to call Watson conversation API in my project. 我正在尝试在我的项目中调用Watson对话API。 I have a .net core project (containing IBM.WatsonDeveloperCloud packages) that I manually changed the target framework to net46 and netstarndard1.3 in .csproj file. 我有一个.net核心项目(包含IBM.WatsonDeveloperCloud软件包),我将目标框架手动更改为.csproj文件中的net46和netstarndard1.3。 here is the .csproj file: 这是.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>

When I run the project I get this error: 当我运行项目时,出现以下错误:

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.'

The solution explorer shows System.Net.Http (4.1.0) under Dependencies->SDK 解决方案资源管理器在Dependencies-> SDK下显示System.Net.Http(4.1.0)

Any comment is appreciated. 任何评论表示赞赏。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法加载文件或程序集&#39;System.Net.Http,Version = 4.1.1.1 .Net Standard - Could not load file or assembly 'System.Net.Http, Version=4.1.1.1 .Net Standard "无法加载文件或程序集 System.Net.Http 版本 4.1.1.0" - Could not load file or assembly System.Net.Http version 4.1.1.0 无法使用单声道加载文件或程序集 System.Net.Http - Could not load file or assembly System.Net.Http using mono 无法加载文件或程序集&#39;System.Net.Http&#39; - Could not load file or assembly 'System.Net.Http' 无法加载文件或程序集 System.Net.Http 4.2.0.0 - could not load file or assembly System.Net.Http 4.2.0.0 无法加载文件或程序集&#39;System.Net.Http - Could not load file or assembly 'System.Net.Http 无法加载文件或程序集&#39;System.Net.Http,版本= 4.2.0.0系统找不到指定的文件 - Could not load file or assembly 'System.Net.Http, Version=4.2.0.0 The system cannot find the file specified Azure失败无法加载文件或程序集&#39;System.Net.Http,版本= 4.2.0.0 - Azure failing Could not load file or assembly 'System.Net.Http, Version=4.2.0.0 无法在.NET Core中加载文件或程序集“System.Runtime,Version = 4.1.0.0” - Could not load file or assembly 'System.Runtime, Version=4.1.0.0' in .NET Core System.Net.Http - 无法加载文件或程序集,然后无法加载要执行的引用程序集 - System.Net.Http - Could not load file or assembly, then Cannot load a reference assembly for execution
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM