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
Microsft Visual Studio Enterprise 2017 (Version 15.4.1)
NuGet Package Manager 4.4.0
Microsoft Windows 10 Enterprise
Detailed repro steps so we can see the same problem
Create a new project (any will do, used console application as an example)
Add a package using the PackageReference format.
Modify the csproj and add a condition to only include the package if the configuration is set to Debug.
According to the Microsoft Documentation (https://docs.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files) under the Comments, someone pointed out that the condition attribute only applies to TargetFramework and not Configuration (or any other condition). The MSFT member suggested posting an issue back in July, but I don't think anyone created an issue since this still does not work and I could not find any related issues when doing a search through the issues (unless I missed it).
Kraig_Brockschmidt-MSFT Jul 17, 2017 @jakub At present, the only supported condition is TargetFramework. This is because the project.assets.json file can contain packages for multiple target frameworks but not multiple configurations or other property values.
Being able to restore packages on conditions other than TargetFramework would be helpful, especially when mixing in floating versions. My original goal was to pull in the highest version on Release and to pull in the highest prerelease (CI version) on Debug.
Details about Problem
Detailed repro steps so we can see the same problem
According to the Microsoft Documentation (https://docs.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files) under the Comments, someone pointed out that the condition attribute only applies to TargetFramework and not Configuration (or any other condition). The MSFT member suggested posting an issue back in July, but I don't think anyone created an issue since this still does not work and I could not find any related issues when doing a search through the issues (unless I missed it).
Being able to restore packages on conditions other than TargetFramework would be helpful, especially when mixing in floating versions. My original goal was to pull in the highest version on Release and to pull in the highest prerelease (CI version) on Debug.
Another (unrelated) item that is a bit of a letdown is that the floating versions don't support "1.-", but that's another issue (#912).
The text was updated successfully, but these errors were encountered: