Questions tagged [packagereference]
100 questions
1
vote
1 answer
PackageReference version is ignored
In our project we're creating different NuGet packages (using suffixes) for different branches. In the .csproj file I'm trying to specify the specific version of a package that should be used.
Package names can be 1.2.3, 1.2.3-rc001, or…

euouae
- 13
- 2
1
vote
0 answers
PackageReference Redirect underlying package?
I'm using a NuGet package (IdentityModel.OidcClient 3.1.2) and this throws an error
Could not load file or assembly 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located…

gjvdkamp
- 9,929
- 3
- 38
- 46
1
vote
1 answer
How to use my own DLLs instead of the one referenced by a dependent package
I'm using a nuget package (let's call it A) which has dependency to another package, let's call it B.
To include A in my project, I changed .csproj file to:
When I run…

Shahryar Saljoughi
- 2,599
- 22
- 41
1
vote
1 answer
PackageReference not copying dll to consumer (test) project output with ExcludeAssets = "runtime" and PrivateAssets = "none"
Simple setup here:
Project A - .NET 4.7.2 framework library project
PackageReference to SeriLog 2.9.0
ExcludeAssets="runtime",
PrivateAssets="none", this is optional because by default it should copy DLLs (setting = "runtime")
TestProject B…

fl0tschi
- 101
- 1
- 6
1
vote
1 answer
Programmatically with C# code restore PackageReferences
I'm trying programmatically with C# base code to restore packageReference for .NET framework & .NET core projects.
I thought about using dotnet.exe / msbuild.exe but I don't know how!
I want to simulate what we can do with dotnet CLI:
dotnet restore…

Tester User
- 175
- 2
- 9
1
vote
0 answers
Getting error attempting to publish a WPF which uses PackageReference
I'm working on upgrading one of our WPF applications. During my upgrade, I converted the application from using the packages.config format for NuGet packages to using the PackageReference format.
Everything seemed to work fine locally, but our build…

myermian
- 31,823
- 24
- 123
- 215
1
vote
1 answer
How do I exclude a dependency of Microsoft.NETCore.APP
How do I exclude a dependency of Microsoft.NETCore.App so I can replace it with a locally compiled (bugfix) version.
I carried out the normal procedure for replacing a package by making one with a higher version number, and tried to compile. The…

Joshua
- 40,822
- 8
- 72
- 132
1
vote
1 answer
Why does dotnet publish not publish the versions expected?
Dealing with CVE-2018-8409, noted that our dotnet publish (.NET Core 2.1.403 ASPNET Core app) is publishing v4.0.0.1 of System.IO.Pipelines.dll in our output directory.
I added a nuget package reference to v4.5.3 of System.IO.Pipelines.
I see no…

John
- 921
- 1
- 9
- 24
1
vote
1 answer
Does PackageReference and package.lock.json remove the need for Binding Redirects in App.Config
In Nuget we can now use PackageReference format for dependencies and also enable repeatable builds using lock files
In my project, I get something along the lines of:
{ "version": 1, "dependencies": {
".NETFramework,Version=v4.6.1": {
…

UmaN
- 905
- 1
- 15
- 29
1
vote
1 answer
PackageReference Resolve Version Logic as API
Is there any accessible API via an MSBuild task, target or otherwise that allows me to query what version of a NuGet package a given PackageReference will resolve (or has already resolved) to?
For example, if I have a csproj with

Jeff
- 35,755
- 15
- 108
- 220
1
vote
1 answer
Manage nuget packages with PackageReferences when .Net Framework+Standard+Core combined
Question:
How to manage nuget packages in a VisualStudio2017 solution with 3 platforms:
.Net Standard 1.3
.Net Framework 4.6
.Net Core 1.0
?
I like the PackageReference approach, but i don't know how to use it. They talk about:
…

Andrey K.
- 665
- 8
- 29
1
vote
0 answers
PackageReference doesn't reference library
When I try to add a package reference to the .csproj file I am having the problem that the actual DLL is not referenced in the project. My example is:
11.0.2
…

Demian
- 81
- 1
- 3
1
vote
1 answer
In which versions of Visual Studio do .NET full framework projects support PackageReference?
According to https://learn.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files
.NET full framework projects support PackageReference
In which versions of Visual Studio is that?

Colonel Panic
- 132,665
- 89
- 401
- 465
1
vote
0 answers
Using ValueTuple with PackageReference on Azure Cloud Services
I'm trying to convert my c# projects from old to new csproj style, but this breaks my Azure cloud service at runtime because the ReferenceAssembly of System.ValueTuple.dll is copied instead of the implementing assembly.
This is the same problem as…

Jonas Nyrup
- 2,376
- 18
- 25
1
vote
1 answer
Visual Studio 2017 Migrating packages.config to PackageReference
When migrating packages.config with Newtonsoft.Json package to the PackageReference csproj format I get compatibility issue:
Newtonsoft.Json v10.0.3, install.ps1 script will be ignored when the package is installed after the migration.
Is this…

petrsyn
- 5,054
- 3
- 45
- 48