Questions tagged [packagereference]

100 questions
4
votes
2 answers

Cannot load file or assembly 'Microsoft.Extensions.Configuration.Abstractions, Version=3.1.0.0' in MSTest project

I'm having problem with MSTest, Here the issue Open VS2019 Make sure that package management is set to [PackageReference] Create a .Net Framework test project Add Nuget package Microsoft.Extentions.Configuration last version (3.1.3.0) Add the…
Khaled
  • 317
  • 2
  • 7
4
votes
2 answers

props and targets with PackageReference in nuget package

I like to create a NuGet package with a .props file in it. The .props file has following content:
crip
  • 145
  • 1
  • 8
4
votes
2 answers

Is it possible to utilize OctoPack with the new PackageReference NuGet format?

We recently upgraded our assemblies to use the PackageReference format instead of the packages.config for our NuGet dependencies. One of the packages, OctoPack, stopped working after doing this. Is there any way to get OctoPack to work while still…
myermian
  • 31,823
  • 24
  • 123
  • 215
4
votes
0 answers

Config file transformation doesn't work on build server after migration to package reference format

I am using Microsoft.VisualStudio.SLowCheetah (v3.0.61) package to transform several configuration files to the release version during the build. Recently i have migrated all projects in the solution from packages.config to package reference format.…
Eugene
  • 127
  • 1
  • 2
  • 8
3
votes
0 answers

net6.0 backward compatibility

Is net6.0 compatible with net5.0 targeted packages? Could not find the answer easily accessible on google. We have a newly upgraded project targeting net6 net6.0 with a PackageReference
Jeff
  • 35,755
  • 15
  • 108
  • 220
3
votes
0 answers

msbuild warnings - MSB3246 & NETSDK1049

I'm working on migrating from packages.config to PackageReference format for multiple csproj files. Restore and build succeeds but with hundreds of warnings. These warnings were not showing before my PackageReference changes to csproj files. Please…
3
votes
2 answers

PackageReference condition is ignored for old project format

I'm trying to centralize some of our project configurations by using the Directory.Builds.props/Directory.Build.targets files. Unfortunately we have a mixture of the old and new (sdk-style) project format. And not all of our projects can be…
2
votes
1 answer

Override Nuget packages dependency in order to use higher version of that dependency

Assuming we have .Net solution which contains multiple projects, one of these projects references a Nuget package A (4.0.0 for example and this is the latest version of the package) that references Newtonsoft.Json (9.0.1) for example, but doesn't…
Mselmi Ali
  • 1,139
  • 2
  • 18
  • 28
2
votes
0 answers

Including WinSCP with PackageReference copies Winscp.exe in MY package

I have a problem with the WinSCP.exe file in my created NuGet package. I reference WinSCP in my project as follows: After packing my NuGet package, the winscp.exe is copied to the package in…
2
votes
0 answers

Updating nuget packages via PackageReference in csproj file

I have a project written with C# with some custom NuGet packages dependencies. I want to install the latest version of any package in local repo .nuget/packages. How can I update my dependencies to the latest version automatically? Should I check…
jeWick
  • 61
  • 3
2
votes
0 answers

Does Roslyn load just metadata references to projects when loading a project into a workspace?

MSBuildLocator.RegisterDefaults(); var workspace = MSBuildWorkspace.Create(); workspace.LoadMetadataForReferencedProjects = true; var solution =…
2
votes
1 answer

NuGet - How to include the application app.config file in the consuming applications build output?

How can I get my NuGet package to include its app.config in the build output directory of a project that consumes the NuGet package? Currently it is only copying the NuGetConfigInclude.exe but I need it to also have the NuGetConfigInclude.exe.config…
Eric Scherrer
  • 3,328
  • 1
  • 19
  • 34
2
votes
1 answer

How to get referenced nuget packages using MSBuildWorkspace?

I'm using MSBuildWorkspace to load solution for analyze using OpenSolutionAsync and then iterating for projects. I cant see any information about nuget packages that are referenced by project. There is MetadataReferences but this is a list of dll’s…
dnf
  • 1,659
  • 2
  • 16
  • 29
2
votes
0 answers

Nuget package init.ps1 script and PackageReference modification

I want to have referenced dll(s) in my package in "copy local = false" mode. In other words, I don't want that the dll(s) my package ships is/are copied into a output directory after the build. The way this can be done in "packages.config" scenario…
Ollikat
  • 81
  • 6
2
votes
2 answers

Nuget package creation not including referenced dlls

I'm using visual studio 2019 community version and the package manager console. I am using .net core 2.2 and Package References is enabled. I want to be able to create one single nuget pack coreproj1 which will also include the dlls for Coreproj2…
UndeadEmo
  • 433
  • 1
  • 6
  • 15