Handle building host test assets with stabilized package versions #109020
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Host test assets are built against the live runtime build, such that the live runtime version is written into their runtimeconfig.json files. The tests are run using a .NET install layout created via the
PublishToDisk
target forMicrosoft.NETCore.App.Bundle.bundleproj
. With stabilized package versions, these ended up with two different versions - the test assets had a version that still included the version suffix (for example,-ci
) while the install layout had the stable version without a suffix.We were relying on the
Version
property in both cases. However, that is computed differently for non-shipping (like the test assets) versus shipping (like the install layout) projects, such that with stabilized package versions, non-shipping assets still had the version suffix while shipping assets did not. This change updates the host test assets build to explicitly check for stabilized package versions and use theProductVersion
property (which has no suffixes) in that case.See #108994. We will need to backport to fix the tests in 9.0.
cc @dotnet/appmodel @AaronRobinsonMSFT