Skip to content

Commit

Permalink
On run package validation for CSProj-built packages
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ericstj committed Mar 11, 2022
1 parent cd4b7bd commit 5dd4c0a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
9 changes: 4 additions & 5 deletions eng/packaging.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

<PropertyGroup>
<!--
Package validation causes flaky errors during the build. Validation isn't useful during
source-build (it is only a guardrail for devs), so disable it during source-build to avoid the
impact on build reliability. https://github.com/dotnet/runtime/issues/60883 tracks fixing the
flakiness and removing this condition.
Disable PackageValidation for non-CSProj since those will load only one roslyn assembly of the wrong
version causing the task to be in torn-state. See https://github.com/dotnet/runtime/pull/61697.
https://github.com/dotnet/runtime/issues/60883 tracks fixing this in 6.0 and removing this condition.
-->
<EnablePackageValidation Condition="'$(DotNetBuildFromSource)' != 'true'">true</EnablePackageValidation>
<EnablePackageValidation Condition="'$(MSBuildProjectExtension)' == '.csproj'">true</EnablePackageValidation>
<!-- Don't restore prebuilt packages during sourcebuild. -->
<DisablePackageBaselineValidation Condition="'$(DotNetBuildFromSource)' == 'true'">true</DisablePackageBaselineValidation>
<PackageValidationBaselineVersion Condition="'$(PackageValidationBaselineVersion)' == ''">6.0.0</PackageValidationBaselineVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
<NoTargetsDoNotReferenceOutputAssemblies>false</NoTargetsDoNotReferenceOutputAssemblies>
<!-- This is a meta package and doesn't contain any libs. -->
<NoWarn>$(NoWarn);NU5128</NoWarn>
<!-- It doesn't make sense to run package validation on native packages -->
<EnablePackageValidation>false</EnablePackageValidation>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
<UseRuntimePackageDisclaimer>true</UseRuntimePackageDisclaimer>
<!-- This is a native package and doesn't contain any ref/lib assets. -->
<NoWarn>$(NoWarn);NU5128</NoWarn>
<!-- It doesn't make sense to run package validation on native packages -->
<EnablePackageValidation>false</EnablePackageValidation>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 5dd4c0a

Please sign in to comment.