You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This doc mentions that one can use Conditions in PackageReferences, but then later it says this only works for targetFramework.
In my scenario I need the ability to bring in one of two possible nuget packages into my csproj, depending on an msbuild variable (different versions of a package). However when I try to use the variable in the condition, VS seems to always include both packages, which obviously isn't what I need.
Is there a way to achieve this? If not, can this issue be turned into a feature request :)
The text was updated successfully, but these errors were encountered:
Team Triage: You can create a property within your project, something like $(NewtonsoftJsonVersion) and set that based off of a condition. Then in your packagereference, use that as your version.
https://github.com/NuGet/docs.microsoft.com-nuget/blob/master/docs/consume-packages/Package-References-in-Project-Files.md#adding-a-packagereference-condition
This doc mentions that one can use Conditions in PackageReferences, but then later it says this only works for
targetFramework
.In my scenario I need the ability to bring in one of two possible nuget packages into my csproj, depending on an msbuild variable (different versions of a package). However when I try to use the variable in the condition, VS seems to always include both packages, which obviously isn't what I need.
Is there a way to achieve this? If not, can this issue be turned into a feature request :)
The text was updated successfully, but these errors were encountered: