packagereference

Disable transitive PackageReference dependency for a specific MsBuild project

本秂侑毒 提交于 2021-02-04 19:36:08
问题 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 PackageReference. On Build Project A uses IL merge to incorporate B as public symbols in the A assembly and C as internalized symbols. Project D have a project reference to A. The transitive dependencies case D to reference A, B and C. When

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

有些话、适合烂在心里 提交于 2021-01-29 02:10:48
问题 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 code below Run test ==> Test fail with error [Cannot load file or assembly Microsoft.Extensions.Configuration.Abstractions, Version=3.1.0.0 ...] error PS : using package.config instead of PackageReference solve the issue. Downgrading to Microsoft

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

百般思念 提交于 2021-01-29 02:08:57
问题 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 code below Run test ==> Test fail with error [Cannot load file or assembly Microsoft.Extensions.Configuration.Abstractions, Version=3.1.0.0 ...] error PS : using package.config instead of PackageReference solve the issue. Downgrading to Microsoft

Nuget: Migrating multiple large Solutions to PackageReference

有些话、适合烂在心里 提交于 2020-04-07 03:49:33
问题 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 PackageReference format. Problem I know Visual Studio provides a solution for migrating a single project from packages.config to the PackageReference format, but I'm not aware of a solution where I can migrate multiple Visual Studio Solutions at once. I

how to resolve “error MSB3188: Assembly … must be strong signed in order to be marked as a prerequisite.”

廉价感情. 提交于 2020-01-16 08:35:33
问题 I've seen several questions on this board which are similar, but I think several problems can cause this message, and my particular problem may not have been among them, and certainly my solution appears much simpler and more effective than any of the others. I have a project which was using packages.config. I used the Visual Studio UI to migrate by projects references from package.config to PackageReference (https://devblogs.microsoft.com/nuget/migrate-packages-config-to-package-reference/).

how to resolve “error MSB3188: Assembly … must be strong signed in order to be marked as a prerequisite.”

此生再无相见时 提交于 2020-01-16 08:35:06
问题 I've seen several questions on this board which are similar, but I think several problems can cause this message, and my particular problem may not have been among them, and certainly my solution appears much simpler and more effective than any of the others. I have a project which was using packages.config. I used the Visual Studio UI to migrate by projects references from package.config to PackageReference (https://devblogs.microsoft.com/nuget/migrate-packages-config-to-package-reference/).

NuGet Package references copies dll local

两盒软妹~` 提交于 2019-12-24 10:54:36
问题 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? 回答1: You can use PrivateAssets. Copied from the docs <ItemGroup> <!-- ... --> <PackageReference Include="Contoso.Utility.UsefulStuff" Version="3.6.0"> <PrivateAssets>all</PrivateAssets> </PackageReference> <!-- ... --> </ItemGroup> edit: actually,

Switch back to packages.config - clarification on answer

一曲冷凌霜 提交于 2019-12-24 00:36:35
问题 In line with the rules, I have to ask a new question, to get some clarification on another question/answer. This answer is this one: https://stackoverflow.com/a/45964469/305916 Then what? Just did the accepted answer, but the packages.config file is not populated with the packages (I know it doesn't say so). I am missing what to do next if the packages appear automatically in the packages.config or I need to install them again... I am leaning towards the latter, but I feel the answer is not

NuGet package shows no dependencies?

偶尔善良 提交于 2019-12-04 14:33:34
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 another NuGet package (that has dependencies). My class library uses packageReferences in .csproj My class library contains a proper .nuspec file I use nuget.exe pack for creating the package The nuget.exe pack command should automatically fill in the needed dependencies - this also used to be the case earlier (in another project). However, at that

NuGet package shows no dependencies?

天大地大妈咪最大 提交于 2019-11-28 01:46:51
问题 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 another NuGet package (that has dependencies). My class library uses packageReferences in .csproj My class library contains a proper .nuspec file I use nuget.exe pack for creating the package The nuget.exe pack command should automatically fill in the