All Questions
835
questions
558
votes
42
answers
412k
views
Assets file project.assets.json not found. Run a NuGet package restore
I'm trying to use nopCommerce(Which is written in .NET Core) but when I want to run the project I face 52 Errors telling me Run a nuget package restore
Assets file ~\obj\project.assets.json' not ...
175
votes
6
answers
110k
views
How do I get .NET Core projects to copy NuGet references to the build output?
I'm trying to write a plugin system with .NET Core, and one of my requirements are to be able to distribute the plugin DLL along with its dependencies to the user for install.
However, I can't figure ...
159
votes
2
answers
53k
views
What are .NET Platform Extensions on docs.microsoft.com?
There is a framework-level navigation element at Microsoft Docs called ".NET Platform Extensions". It contains docs on recently added APIs like System.IO.Pipelines and System.Threading.Channels for ...
130
votes
22
answers
154k
views
Detected package downgrade warning (dotnet core, vs 2017)
I have just updated all my nuget packages for my solution (dotnet core 1.1 project).
I am now getting the following warnings and I don't really know what they mean.
Update: I am still getting ...
129
votes
19
answers
173k
views
Error NU1605 Detected package downgrade
I am experiencing the following NU1605 dependency errors in my netcoreapp2.0 console application:
NU1605 Detected package downgrade: System.Diagnostics.Debug from 4.3.0 to 4.0.11. Reference the ...
101
votes
3
answers
7k
views
What are the application implications of a netstandard library depending on a metapackage?
Suppose I have a class library which I want to target netstandard1.3, but also use BigInteger. Here's a trivial example - the sole source file is Adder.cs:
using System;
using System.Numerics;
...
97
votes
9
answers
22k
views
The author primary signature's timestamp found a chain building issue: UntrustedRoot: self signed certificate in certificate chain
While doing a docker build on my .NET Core project, I got the following error on all my NuGets:
80.19 /app/GradingTool.Tests/GradingTool.Tests.csproj : error NU3028: Package 'Microsoft....
96
votes
4
answers
69k
views
dotnet restore warning NU1701
I am using .NET Core with C#, and when I did dotnet restore, it gave the following error:
PS C:\workspace\Arbitrator> dotnet restore
C:\workspace\Arbitrator\Arbitrator.csproj : warning NU1701: ...
93
votes
11
answers
64k
views
'ILoggerFactory' does not contain a definition for 'AddConsole'
private ILoggerFactory ConfigureLogging(ILoggerFactory factory)
{
factory.AddConsole();
return factory;
}
I have found the piece of code above on Github. It gives the following error:
'...
89
votes
4
answers
40k
views
Why isn't there any packages folder in my .NET Core solution's containing folder?
Are packages now cached in a more shared location somewhere or what?
My solution folder is devoid of any packages folder:
78
votes
6
answers
89k
views
Add a package with a local package file in 'dotnet'
Using the dotnet command line tool, how can I add a reference to an existing local package that is not downloaded with NuGet?
I have tried adding a local package to a project bar with dotnet:
dotnet ...
78
votes
2
answers
33k
views
What's the difference between the new netstandardapp and netcoreapp TFMs?
I noticed that NuGet has recently added support for several new TFMs related to .NET Core, including:
netstandard (1.0-1.5)
netstandardapp (1.5)
netcoreapp (1.0)
To the best of my knowledge, ...
75
votes
1
answer
40k
views
What does PrivateAssets='All' mean?
When I build my .NET Core (NETStandard v2.0) project I am getting the following warning:
ViewModels: [FodyPackageReference] Fody: The package reference for PropertyChanged.Fody
does not contain ...
72
votes
11
answers
54k
views
How do I update all NuGet packages at once with the dotnet CLI?
I'm trying to update all NuGet packages for a solution in VS Code (using Mac). Is there a way to achieve that in VS code or for a specific project.json file? At the moment I'm going one by one but I ...
71
votes
10
answers
107k
views
Nuget restore fails on Azure Devops with message "unable to load the service index for source"
I have a build for a .NET solution that is running in a private agent. The solution contains both .NET Core 2.1 and .NET Standard 2.0 projects.
Some of the nuget packages installed are the following:...
67
votes
3
answers
39k
views
.Net Core and NuGet
I installed .net core from this site. Playing with it led to a number of related package management questions:
The dotnet restore command proceeded to "install" .net core NuGet packages. Where were ...
66
votes
1
answer
18k
views
Upgrading to .NET Core 2.0: PackageTargetFallback and AssetTargetFallback cannot be used together
When upgrading a project that is compiling and running fine on .NET Core 1.0 or 1.1, updating the target framework to .NET Core 2.0 (netcoreapp2.0) causes the build to fail with the following error:
...
61
votes
3
answers
75k
views
Nuget - Package restore failed. Rolling back package changes for 'WebApplication1'. 0
It's my own custom nuget package that I've not published yet and testing locally.
The nuget package consists of a dll file and nuspec file is as follows.
<?xml version="1.0"?>
<package >
...
55
votes
9
answers
28k
views
Microsoft.AspNetCore.App 2.1.1 upgrade "Blocked by project"
I'm trying to upgrade a .net core 2.1 project to the latest version of Nuget packages such as Microsoft.Extensions.DependencyInjection.Abstractions 2.1.1.
However this is blocked by the package ...
54
votes
2
answers
44k
views
What's the difference between <TargetFramework> and <RuntimeFrameworkVersion>?
I have the following code in a csproj file:
<TargetFramework>netcoreapp1.0</TargetFramework>
In the NuGet package manager, it says that I have Microsoft.NETCore.App version 1.0.5
Now let'...
53
votes
3
answers
16k
views
Automatic native and managed DLLs extracting from Nuget Package
This is driving me crazy for several months now and I'm still not able to achieve it. My managed libraries are extracted from the Nuget package but not the natives ones.
We have a bunch of managed and ...
49
votes
2
answers
49k
views
Where's the NuGet package location in ASP.NET Core?
I'm new to ASP.NET Core, and am trying to figure out where NuGet packages are stored on my local machine.
I've installed the following NuGet packages:
nuget dapper
nuget MicroOrm.Pocos.SqlGenerator
...
49
votes
10
answers
66k
views
Detected package downgrade: Microsoft.NETCore.App from 2.1.3 to 2.1.0
I try to update my .net solution from .NET Core 1.1 to .NET Core 2.1. I have several .NET Core and .NET standard projects inside, which reference each other and another NuGet packages. After update '...
41
votes
5
answers
13k
views
Docker build complains it can't find nuget fallback package folder
I'm following the tutorial at https://learn.microsoft.com/en-us/dotnet/core/docker/docker-basics-dotnet-core#dockerize-the-net-core-application in learning to containerise .net core applications into ...
41
votes
3
answers
46k
views
Change NuGet package folders used by Visual Studio
There is no more packages solution folder in any csproj or project.json-based .NET Core project.
NuGet CLI gets the list of used cache folders:
nuget locals all -list
Response:
http-cache: C:\...
41
votes
1
answer
17k
views
List all the nuget packages with "dependencies recursively" for a given project/Solution for .NET Core project in VS2017
I want to list down all the nuget packages along with its dependencies recursively.
Project is in VS2017 and .NET Core.
I tried with Get-Package -ProjectName "Your.Project.Name" it displays all the ...
41
votes
1
answer
5k
views
Best way to force an update of a transitive nuget package dependency?
Consider a .NET Core application (A), which references a third-party nuget package (B) using the PackageReference model. Package B has it's own dependency on another package (C):
A -> B -> C
...
40
votes
5
answers
26k
views
Including referenced project DLLs in nuget package [.Net Core RC3 *.csproj file]
I have a solution with two projects in it. First project is called Library1, which references project two called Referencelibrary. I am trying to embed the DLLs for ReferenceLibrary inside Library1's ...
39
votes
12
answers
89k
views
Could not load file or assembly Microsoft.Extensions.Logging.Abstractions
I'm using VS2019 Pro v16.3.5
I have a solution containing an Azure functions project which references several class library projects.
The top-level project fails to compile with the following error:...
35
votes
6
answers
32k
views
Include all dependencies using dotnet pack
Is there any way to force dotnet pack to include all referenced assemblies (all dependencies in project.json)?
I believe this is related:
https://github.com/dotnet/cli/issues/1290
https://github.com/...
32
votes
4
answers
39k
views
was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '
I am trying to reference a nuget package which is clearly .NetStandard2.0. We own the source code for this package and written it to target .netstandard. We do have a CI pipeline so that when we push ...
31
votes
9
answers
29k
views
Azure Devops publishing to own feed suddenly results in 403 forbidden
I have been using Azure DevOps for a project for quite some time, but suddenly publishing to my own organisation/collection feed results in a 403.
I created a feed and I can select it on the nuget ...
31
votes
3
answers
13k
views
what is major difference between dotnet publish and dotnet pack
What is the major difference between dotnet pack and publish?
From Microsoft's description, my understanding is that pack creates a package while publish creates package + DLL.
Is this correct?
If ...
27
votes
2
answers
17k
views
Visual Studio 2017 only has offline Nuget Packages for .NET Core 2.x. How to get online packages?
I want to get NuGet Packages from Nuget online, but Visual Studio is only giving me 'Microsoft Visual Studio Offline Packages' as an option.
I have tried adding another package source using the ...
26
votes
2
answers
33k
views
How do I register a new NuGet package source with dotnet CLI on Ubuntu 14.04?
I am running .NET Core 1.1.0 on Ubuntu 14.04, with the goal of hosting my Web APIs in Docker on Ubuntu. I want to build my packages on Ubuntu, but some of the NuGet references are hosted on an ...
24
votes
3
answers
5k
views
Show outdated nuget packages with dotnet CLI
I'm using .NET Core, VS Code, Linux.
To update a package, I manually change the version in the .csproj and then run dotnet restore.
But how can I tell which packages are outdated using the dotnet ...
22
votes
5
answers
39k
views
How to add private nuget source in dotnet dockerfile?
I try to add (override) a private nuget source to my build script in order to add the user/pw - and keep it out of my source control. What I tried so far:
nuget is not recognized as command inside ...
21
votes
2
answers
43k
views
Unable to find package . No packages exist with this id in source. .NET core
I am trying to use a project as nuget package in other solution.
The project i want to use has 2 references to other projects in the solution he is at.
I am creating the .nupkg file using the cli ...
21
votes
3
answers
16k
views
Netstandard1.x Nuget packages cannot be installed for netstandard1.x projects
After doing a fresh Windows 10 installation along with latest Visual Studio 2015, netcore, and nuget tooling - I can no longer install Nuget packages to any .netstandard projects. Here's some example ...
21
votes
2
answers
7k
views
How to package a portable .NET library targeting .NET Core?
How do I package a portable .NET library in a modern general-purpose way? Let's assume I have a single AnyCPU assembly that I wish to make available to any .NET platform that supports the .NET Core ...
20
votes
7
answers
10k
views
How to Update All Packages of solution to Latest Minor Version Nuget?
Stick together with minor versions of updated packages, in the entire solution.
Ideally Update-Package should do but that command will pick up latest
version of all packages, no matter what.
...
19
votes
3
answers
15k
views
dotnet pack - How do you specify the name of the package?
I am trying to pack a library as a NuGet package in powershell, like so:
function Create-NuGetPackages($projects) {
if (!(Test-Path $NuGetPackageDirectory)) {
New-Item $...
19
votes
9
answers
62k
views
How to resolve "NuGet package restore failed" in Visual Studio?
I got an error
NuGet package restore failed. Please see Error List window for detailed warnings and errors.
while building my solution. Package manager can't restore my 2 projects:
Unable to ...
18
votes
2
answers
7k
views
Can't upgrade or downgrade NuGet package
I have a ASP.NET Core website, and it relies on 2 class libraries.
They all reference Microsoft.NETCore but the versions have got mixed up somehow and has lead me to receive warnings:
Detected ...
16
votes
4
answers
5k
views
Different NuGet package based on operating system
I have a test project in dotnet 2.1 that needs to work across multiple platforms (specifically, windows and linux-based systems) as well as access DB2 databases.
IBM provides separate NuGet packages ...
16
votes
2
answers
12k
views
RS232 library for .net core
We are developing applications in .Net Core and one of them require to access a serial port.
As I learned that System.IO.Ports won't be implemented in .Net Core, I was looking for a nuget library ...
16
votes
3
answers
10k
views
How to download a nupkg package from nuget programmatically in .NET Core?
In past with .NET Framework I used this example for working with nuget programmatically
Play with Packages, programmatically!
Is there any equivalent source for .NET Core?
//ID of the package to ...
16
votes
0
answers
572
views
Compiler errors when consuming NuGet packages from an F# library targeting .NET Core
I am having some trouble opening namespaces in certain NuGet packages (e.g. Newtonsoft.Json and Microsoft.EntityFrameworkCore.SqlServer) when targeting .NET Core from an F# library project.
Here are ...
15
votes
6
answers
26k
views
where does the "Unable to find fallback package folder" nuget error come from, when building project in a dockerfile?
When building, from a dockerfile, I get this:
/usr/share/dotnet/sdk/3.1.102/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(234,5): error MSB4018: The "...
15
votes
3
answers
7k
views
Can I update to .Net 5 NuGet packages even if I'm using .Net Core 3.1?
I was looking for some NuGet updates about my project libraries. I see that there are a lot of Microsoft libraries update to v5.0.0.
Based on my knowledge I think these are new dependencies released ...