Skip to content

Commit 5dd4c0a

Browse files
committed
On run package validation for CSProj-built packages
This fixes an issue where a non-CSProj built package would load MS.CA.dll , then a CSProj would try to load MS.CA.CS.dll of a different version and it's MS.CA types would not agree with those already bound to the task from previous load. Further details: dotnet/sdk#22277
1 parent cd4b7bd commit 5dd4c0a

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

eng/packaging.targets

+4-5
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22

33
<PropertyGroup>
44
<!--
5-
Package validation causes flaky errors during the build. Validation isn't useful during
6-
source-build (it is only a guardrail for devs), so disable it during source-build to avoid the
7-
impact on build reliability. https://github.com/dotnet/runtime/issues/60883 tracks fixing the
8-
flakiness and removing this condition.
5+
Disable PackageValidation for non-CSProj since those will load only one roslyn assembly of the wrong
6+
version causing the task to be in torn-state. See https://github.com/dotnet/runtime/pull/61697.
7+
https://github.com/dotnet/runtime/issues/60883 tracks fixing this in 6.0 and removing this condition.
98
-->
10-
<EnablePackageValidation Condition="'$(DotNetBuildFromSource)' != 'true'">true</EnablePackageValidation>
9+
<EnablePackageValidation Condition="'$(MSBuildProjectExtension)' == '.csproj'">true</EnablePackageValidation>
1110
<!-- Don't restore prebuilt packages during sourcebuild. -->
1211
<DisablePackageBaselineValidation Condition="'$(DotNetBuildFromSource)' == 'true'">true</DisablePackageBaselineValidation>
1312
<PackageValidationBaselineVersion Condition="'$(PackageValidationBaselineVersion)' == ''">6.0.0</PackageValidationBaselineVersion>

src/libraries/System.IO.Ports/pkg/runtime.native.System.IO.Ports.proj

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
<NoTargetsDoNotReferenceOutputAssemblies>false</NoTargetsDoNotReferenceOutputAssemblies>
77
<!-- This is a meta package and doesn't contain any libs. -->
88
<NoWarn>$(NoWarn);NU5128</NoWarn>
9-
<!-- It doesn't make sense to run package validation on native packages -->
10-
<EnablePackageValidation>false</EnablePackageValidation>
119
</PropertyGroup>
1210

1311
<ItemGroup>

src/libraries/System.IO.Ports/pkg/runtime.native.System.IO.Ports.props

-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
<UseRuntimePackageDisclaimer>true</UseRuntimePackageDisclaimer>
1414
<!-- This is a native package and doesn't contain any ref/lib assets. -->
1515
<NoWarn>$(NoWarn);NU5128</NoWarn>
16-
<!-- It doesn't make sense to run package validation on native packages -->
17-
<EnablePackageValidation>false</EnablePackageValidation>
1816
</PropertyGroup>
1917

2018
<ItemGroup>

0 commit comments

Comments
 (0)