dotnet-restore

dotnet restore not using PackageReference condition

落花浮王杯 提交于 2021-02-09 09:21:06
问题 my project has multiple target frameworks, 2 of the package reference need to use a different version for .net461 when building in VS 2017 everything works and the dependency shows using the right versions. but when build using dotnet cli, the dependency shows the wrong version is being use for .net461. is this a bug in dotnet cli? I also try putting those 2 pkg in another ItemGroup tag with condition but still the same update: for anyone else running in to this issue, I ended up using

Azure DevOps - conditional package restoration

限于喜欢 提交于 2021-02-08 04:32:12
问题 A solution that is built via Azure DevOps pipeline has some projects that use conditional package references such as: <Choose> <When Condition="'$(Configuration)'=='Debug'"> <ItemGroup> <PackageReference Include="Mock.MyPackage" Version="1.0.0" /> </ItemGroup> </When> <Otherwise> <ItemGroup> <PackageReference Include="MyPackage" Version="1.2.0" /> </ItemGroup> </Otherwise> </Choose> The package source is a private NuGet feed. The dotnet restore task does not respect the conditional package