C# 由于Watson的包问题引发异常

C# 由于Watson的包问题引发异常,c#,nuget,watson-conversation,watson-assistant,C#,Nuget,Watson Conversation,Watson Assistant,我想在VisualStudio2015中制作一个C#应用程序,该应用程序利用IBM的Watson Assistant SDK,其中包含可以找到的相关信息。但是,当我运行代码并初始化AssistantService的实例时,它抛出System.Security.VerificationException,弹出窗口突出显示调用的构造函数,其中 发生“System.Security.VerificationException”类型的异常 在System.Net.Http.Formatting.dll中

我想在VisualStudio2015中制作一个C#应用程序,该应用程序利用IBM的Watson Assistant SDK,其中包含可以找到的相关信息。但是,当我运行代码并初始化
AssistantService
的实例时,它抛出System.Security.VerificationException,弹出窗口突出显示调用的构造函数,其中

发生“System.Security.VerificationException”类型的异常 在System.Net.Http.Formatting.dll中,但未在用户代码中处理 附加信息:方法 System.Net.Http.CloneableExtensions.Clone:类型参数 “System.Net.Http.Headers.MediaTypeHeaderValue”违反了该约束 类型参数“T”的

我做了一些研究,显然知道问题与
System.Net.Http
软件包有关,我根据前一个线程中的建议将其恢复为4.0.0版,但没有效果。如果有帮助,我可以提供有关我的设置、代码和错误的更多信息。提前感谢任何人能够提供的建议

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using IBM.WatsonDeveloperCloud.Assistant.v1;

namespace Watson_Test
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        AssistantService _assistant;

        public MainWindow()
        {
            InitializeComponent(); 
            _assistant = new AssistantService();
            Console.WriteLine("Success!");                 
        }
    }
}
使用系统;
使用System.Collections.Generic;
使用System.Linq;
使用系统文本;
使用System.Threading.Tasks;
使用System.Windows;
使用System.Windows.Controls;
使用System.Windows.Data;
使用System.Windows.Documents;
使用System.Windows.Input;
使用System.Windows.Media;
使用System.Windows.Media.Imaging;
使用System.Windows.Navigation;
使用System.Windows.Shapes;
使用IBM.WatsonDeveloperCloud.Assistant.v1;
沃森检验
{
/// 
///MainWindow.xaml的交互逻辑
/// 
公共部分类主窗口:窗口
{
助理服务助理;
公共主窗口()
{
初始化组件();
_助理=新的助理服务();
Console.WriteLine(“成功!”);
}
}
}

下面是我的整个程序输出的一个示例

我想汇报一下这件事。我可以通过将所有软件包更新到当前版本来解决问题,因为由于某些依赖关系冲突,它不允许我更新System.Net.Http。在那之后,我将System.IO.Compression恢复到版本4.1.0,这将NETStandard.Library恢复到版本1.6.0,同样是由于依赖性

现在一切都很好,希望这能帮助其他人做这类事情