简体   繁体   中英

How to embed nuget package .Net Standard into a project C#?

I have a project in .Net Standard an it uses several Nugets. for example Newtonsoft.Json. When I want to use this dll in another project, some errors occur and it says Unable to resolve dependencies. I want to embed nuget into my project. What should I do?

Clear the NuGet cache files. You do this in the following way:
  1. In the toolbar of Visual Studio, navigate to Tools » NuGet Package
    Manager » Package Manager Settings.

  2. In the left pane, navigate to NuGet Package Manager » General. Click Clear All NuGet Cache(s).

  3. To do this, navigate to Tools » NuGet Package Manager » Package Manager Settings » Package Sources.

  4. Delete all packages from the packages folder, located in your project's folder.

  5. Reinstall Newtonsoft.Json to the desired version. Rebuild the project.

Depending on the project and the underlying framework, some versions of .NET do not support .NET Standard. You should check the versions of your project and the .NET Standard NuGet you're trying to reference.

Here you could find data (from Microsoft) on the current support status for .NET Standard.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM