Questions tagged [packagereference]
100 questions
0
votes
3 answers
Dotnet pack with projectstyle PackageReference on Azure Devops fails with "NuGet Error NU5019: File not found"
I'm trying to produce a NuGet package from a C# project on Azure DevOps.
I've set up a 'dotnet pack' task in a build pipeline for generating the package.
The project is targeting netstandard20.
The projectstyle is PackageReference.
It has some…

Peter Villani
- 3
- 2
0
votes
1 answer
Nuspec dependencies necessary with PackageReferences
imagine the following situation:
Project A has some NuGet dependencies (ie Project Z, Project Y and Project X). It uses PackageReferences.
Now I want to pack Project A as a .nupkg using a .nuspec file. In a .nuspec file you can declare other NuGet…

PanCave
- 21
- 8
0
votes
0 answers
PackageReferenec in ASP.NET MVC 5 project
I am trying to migrate an ASP.NET MVC 5 Website project from packages.config to use Package Reference. Our project uses .NET Framework 4.6.1. I have looked at the various articles online, but most of them are focused towards .NET Core projects.
I…

Marshal
- 6,551
- 13
- 55
- 91
0
votes
1 answer
A Nuget package copies the static files from its reference project when installed
I have a project called "A" project, and it contain some static files (like dll or others).
And it's csproj is as follow
Always
…

CYL
- 95
- 1
- 12
0
votes
1 answer
Visual Studio: Copy files into output with their package
I have a project called "A" project, and it contain some files (like dll or others).
In my main project, I used "Project Reference" to reference this project, and add some context into the .csproj of A as follow:
…

CYL
- 95
- 1
- 12
0
votes
1 answer
How to exclude some directories from imported nuget package in a Xamarin (VS) project
I'm working on a mobile application in xamarin, which uses certain third party nuget package, and I would like to prevent some of the directories from that nuget package being included in final release, but I can't find any information on how to…

hr4bi0
- 13
- 4
0
votes
0 answers
.net standard old csproj, migrate to packageReference
I want to migrate packages.config to packagesReference. I have solution consisting of 46 projects, For ASP.NET it's not possible to migrate whole .SLN so we need to go one project by one using this workaround -> packageReference issue for asp.net
I…

Rafał Głębocki
- 23
- 5
0
votes
2 answers
(Nuget PackageReference) Xamarin app builds even when I don't add a reference to Xamarin.Forms
I have a solution with a bunch of Xamarin.Forms cross-platform apps. I'm in the middle of a refactoring where I'm migrating things to Nuget PackageReferences. While doing so I encountered a few problems with portable app projects that referenced…

Simon Corcos
- 962
- 14
- 31
0
votes
1 answer
NuGet Framework package with dependencies from Core project
I am trying to reference from a .NET Core 3.1 project, a NuGet package that targets only net40 via the NuGet compatibility shim. The package is added to my project, however the net40 dependencies are not.
The package is structured as:
lib\
net40\
…

Terrence
- 747
- 1
- 10
- 27
0
votes
1 answer
Newer versions of NuGet.exe can't resolve framework match when restoring older packages (net40, netframework40)
having spent the better part of two days on this, time to get some help.
I am reworking our CI build, and have a VS2017 solution which was on .net 4.6.1, using packages.config style nuget refs, and TeamCity was using the NuGet runner v3.4.4 to…

jessewolfe
- 372
- 3
- 10
0
votes
0 answers
NuGet restore package.config and PackageReference with NuGetCommand@2 Azure Pipeline task
I'm currently working on a YAML pipeline in Azure pipelines and have run into a snag. I already have a work around; however, I was curious if anyone has encountered this and solved for it properly. Here is the issue.
I have a project that contains…

Source Code
- 201
- 1
- 7
0
votes
1 answer
Why do some NuGet package dlls get copied to the solution's output directory and some don't?
I have a solution with two projects, project A and project B. Project A is the startup project and references project B. Project B has a few NuGet packages including EMGU.CV and MaterialDesignThemes. EMGU.CV copies it's dll to project A's output…

Vic
- 55
- 7
0
votes
2 answers
.Net PackageReference, explicitly define version of dependent package
In one of my projects I use AutoFixture.AutoMoq package which depends on Moq package
4.11.0
and in another project I use Moq…

tommyk
- 3,187
- 7
- 39
- 61
0
votes
1 answer
Package reference condition - exclude for some project
I have the following entry in Package.props file on solution level:
all
…

SimonD
- 1,441
- 2
- 18
- 30
0
votes
1 answer
Why are PackageReference's references not working for msbuild and shared projects?
After migrating from packages.config to PackageReferences (.NET4.5 Project) the build (msbuild) is broken.
error CS0246: The type or namespace name 'anynugetpackage' could not be found (are you missing a using directive or an assembly…

theBro
- 66
- 5