Skip to content

Commit

Permalink
[dotnet] Limit custom dotnet/runtime selection to the current .NET ve…
Browse files Browse the repository at this point in the history
…rsion. (#20840)

This way any tests using the previous .NET version still works.
  • Loading branch information
rolfbjarne authored Jul 10, 2024
1 parent 7ddf128 commit ed77cd6
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions tests/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,16 @@
<KnownFrameworkReference Update="Microsoft.NETCore.App.Mono" RuntimeFrameworkVersion="$(CUSTOM_DOTNET_VERSION)" />
</ItemGroup>

<ItemGroup Condition="'$(TRACKING_DOTNET_RUNTIME_SEPARATELY)' != ''">
<KnownFrameworkReference Update="Microsoft.NETCore.App">
<RuntimeFrameworkVersion>$(MicrosoftNETCoreAppRefPackageVersion)</RuntimeFrameworkVersion>
</KnownFrameworkReference>
</ItemGroup>

<Target
Name="UpdateKnownRuntimePackWithCustomRuntime"
Condition="'$(TRACKING_DOTNET_RUNTIME_SEPARATELY)' != ''"
BeforeTargets="ProcessFrameworkReferences">
<ItemGroup>
<KnownRuntimePack Update="Microsoft.NETCore.App">
<LatestRuntimeFrameworkVersion>$(MicrosoftNETCoreAppRefPackageVersion)</LatestRuntimeFrameworkVersion>
<KnownFrameworkReference Update="Microsoft.NETCore.App" Condition="'%(TargetFramework)' == 'net$(BundledNETCoreAppTargetFrameworkVersion)'">
<RuntimeFrameworkVersion>$(MicrosoftNETCoreAppRefPackageVersion)</RuntimeFrameworkVersion>
</KnownFrameworkReference>
<KnownRuntimePack Update="Microsoft.NETCore.App" Condition="'%(TargetFramework)' == 'net$(BundledNETCoreAppTargetFrameworkVersion)'">
<LatestRuntimeFrameworkVersion>$(MicrosoftNETCoreAppRefPackageVersion)</LatestRuntimeFrameworkVersion>
</KnownRuntimePack>
</ItemGroup>
</Target>
Expand Down

7 comments on commit ed77cd6

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.