Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/300.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
如何将nuget package.Net标准嵌入到项目C#中?_C#_Nuget_.net Standard 2.0 - Fatal编程技术网

如何将nuget package.Net标准嵌入到项目C#中?

如何将nuget package.Net标准嵌入到项目C#中?,c#,nuget,.net-standard-2.0,C#,Nuget,.net Standard 2.0,我在.Net标准中有一个项目,它使用了几个NUGET。例如Newtonsoft.Json。当我想在另一个项目中使用此dll时,会出现一些错误,并显示无法解析依赖项。 我想将nuget嵌入到我的项目中。我该怎么办 Clear the NuGet cache files. You do this in the following way: 在Visual Studio的工具栏中,导航到工具»NuGet Package 管理器»包管理器设置 在左侧窗格中,导航到NuGet Package Manag

我在.Net标准中有一个项目,它使用了几个NUGET。例如Newtonsoft.Json。当我想在另一个项目中使用此dll时,会出现一些错误,并显示
无法解析依赖项。
我想将nuget嵌入到我的项目中。我该怎么办

Clear the NuGet cache files. You do this in the following way:
  • 在Visual Studio的工具栏中,导航到工具»NuGet Package
    管理器»包管理器设置

  • 在左侧窗格中,导航到NuGet Package Manager»General。点击 清除所有NuGet缓存

  • 为此,请导航至工具»NuGet Package Manager»Package Manager设置»软件包源

  • 从项目文件夹中的“包”文件夹中删除所有包

  • 重新安装
    Newtonsoft.Json
    至所需版本。重建项目


  • 根据项目和底层框架的不同,.NET的某些版本不支持.NET标准。您应该检查您的项目版本和您尝试引用的.NET标准NuGet


    您可以找到有关.NET标准当前支持状态的数据(来自Microsoft)。

    在我的情况下,这些版本彼此兼容。我的问题是,当我在新项目中使用dll时,我必须手动下载依赖项。这就是为什么我想将nuget包嵌入到我的dll中