Questions tagged [packagereference]
100 questions
                    
                    35
                    
            votes
                
                1 answer
            
        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
Package B declares a dependency on C with a version…
         
    
    
        Chris Brook
        
- 2,335
- 20
- 24
                    21
                    
            votes
                
                2 answers
            
        nuget package reference blue icon in visual studio 2017
For some reason in my console app, couple of the reference that I installed thru nuget shows the blue nuget icon. I can build my project locally, but not after I deploy my project to cloud. The error msg is complaining about not able to find these 2…
         
    
    
        checai
        
- 836
- 4
- 11
- 17
                    14
                    
            votes
                
                2 answers
            
        NuGet package shows no dependencies?
I try to make a NuGet package from a .NET 4.7.2 class library (VS2017), but the resulting NuGet package surprisingly shows no dependencies (which is an error).
My setup is like this:
My class library is .NET Framework 4.7.2
My class library uses…
         
    
    
        Martin Christiansen
        
- 1,037
- 3
- 9
- 28
                    14
                    
            votes
                
                0 answers
            
        ClickOnce Application with PackageReferences auto to Prerequisites
How can I get PackageReference packages to be included with the ClickOnce automatically?
I am trying to convert a ClickOnce application from packages.config to use PackageReferences as I have a good 30+ nuget packages (mostly dependencies) and it it…
         
    
    
        Nathan A
        
- 11,059
- 4
- 47
- 63
                    11
                    
            votes
                
                1 answer
            
        Migration from packages.config to PackageReferences causes Could not load file or assembly "..." or one of its dependencies. Access is denied
After upgrading our projects to PackageReferences I am facing the following issue on the build server (on-premise AzureDevOps agents) 
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Xaml.targets(193,5): 
Error XC1000: XC1020: Build error…
         
    
    
        Kostek
        
- 111
- 6
                    10
                    
            votes
                
                2 answers
            
        Nuget: Migrating multiple large Solutions to PackageReference
Background
I'm working on a big project with multiple large solutions. All in all we have over 400 C#-Projects. In the past we used Nuget with the packages.config file for our dependencies. Now we want to migrate all of the projects to the new…
         
    
    
        Niklas
        
- 417
- 6
- 17
                    9
                    
            votes
                
                2 answers
            
        How to include XML Documentation from Nuget Package in csproj build output
I have a nuget package that includes an XML documentation file.
packages/MyPackage.1.0.0/lib/net472/MyPackage.xml
However when I build my project, I want to include this xml file in the output.
So when I:
dotnet MyProj.csproj -c Release 
I want to…
         
    
    
        Tim
        
- 2,968
- 5
- 29
- 55
                    7
                    
            votes
                
                3 answers
            
        NuGet Package references copies dll local
I have some requirement to set Copy Local to false for the NuGet dll. Before that, I used the package.config format and everything worked fine. After migration to Package Reference format, I cannot find a way how to do that. Could someone help me?
         
    
    
        Andrey Lukoprov
        
- 77
- 1
- 1
- 6
                    7
                    
            votes
                
                3 answers
            
        Disable transitive PackageReference dependency for a specific MsBuild project
I am migrating an old style MsBuild csproj project to using PackageReference format and have run into a problem with transitive dependencies.
Consider the following
Project A reference NuGet package B and C, each containing one single assembly using…
         
    
    
        Viktor Griph
        
- 396
- 3
- 8
                    7
                    
            votes
                
                2 answers
            
        Failed to use use "MSBuild.ILMerge.Task" with PackageReference
When using MSBuild.ILMerge.Task referenced via packagereference the following error came up:
error MSB4018: The "MSBuild.ILMerge.Task" task failed unexpectedly.
error MSB4018: System.IO.FileNotFoundException: Cannot find ILMerge 
executable.
error…
         
    
    
        Demian
        
- 81
- 1
- 3
                    7
                    
            votes
                
                0 answers
            
        Reference DLLs from subfolder of a NuGet package with PackageReference
We are upgrading a project from packages.config to the PackageReference structure. One of the packages referenced has DLLs in subfolders like:
lib\net45\some.dll
lib\net45\xxx\other.dll
When referencing this package from a project using…
         
    
    
        MBL
        
- 151
- 4
                    6
                    
            votes
                
                1 answer
            
        VS2017 nuget keeps searching for packages in wrong location
So I migrated from nuget packages.config to PackageReference and found out there were some compatibility issues. I reverted the project to its working state (before the PackageReference) and now my project is not compiling. 
I get the following…
         
    
    
        ChipNugget
        
- 363
- 1
- 7
- 17
                    6
                    
            votes
                
                1 answer
            
        PackageReference Versioning Wildcard csproj
I have the following in my NetStandard Project
 
When I change it to use the wildcard (instead of 1.0.1) I get an exclamation mark on the dependencies toggle, then…
         
    
    
        The_Chud
        
- 991
- 1
- 11
- 24
                    6
                    
            votes
                
                3 answers
            
        Constrain PackageReference upgrade version when update-package run
Under .NET's older packages.config system for NuGet, I could constrain the possible versions of a package that are considered when packages are updated by using the allowedVersions attribute on the Package element
        
            
            
                
                    
    
    
         
    
    
                
            
        
     
 
    
    
        Dav Evans
        
- 4,031
- 7
- 41
- 60
                    4
                    
            votes
                
                2 answers
            
        Where is Visual Studio 2022 storing the nupkg-files
I use Visual Studio 2022. There I have seen, that it stores the NuGet-Packages-Reference in the csproj-File as PackageReference.
Now I am searching for the nupkg-files. Where are they stored in Visual Studio 2022? I didn't find them.
         
    
    
        BennoDual
        
- 5,865
- 15
- 67
- 153