Fix .NET 8 build and L1 test execution#5474
Open
tarunramsinghani wants to merge 15 commits intomasterfrom
Open
Fix .NET 8 build and L1 test execution#5474tarunramsinghani wants to merge 15 commits intomasterfrom
tarunramsinghani wants to merge 15 commits intomasterfrom
Conversation
- Add System.Threading.Tasks.Dataflow package reference to fix NU1605 package downgrade error for .NET 8 builds - Add DOTNET_ROOT export to ensure tests use local SDK runtime (10.0.1) instead of global - Add target framework validation to catch invalid values like '.net8.0' early with helpful error message
Convert DOTNET_ROOT to Windows-style path (C:\path) on Windows platform so that native dotnet test commands can locate the correct runtime.
Print dotnet location (where/which), DOTNET_ROOT, and available runtimes before running tests to help troubleshoot runtime resolution issues.
The testhost was failing to find the .NET runtime because DOTNET_ROOT contained '..' which wasn't being resolved correctly. Using 'cd && pwd' ensures we get a clean absolute path that the runtime host can use.
The testhost process wasn't finding the runtime because DOTNET_ROOT set in bash wasn't being inherited by child processes spawned by MSBuild. Use the Exec task's EnvironmentVariables attribute to explicitly pass DOTNET_ROOT to ensure the testhost can locate the .NET runtime.
…ution The native testhost.exe was probing for .NET runtime next to itself instead of respecting DOTNET_ROOT. By excluding build assets from Microsoft.TestPlatform.TestHost, VSTest falls back to using dotnet testhost.dll which properly respects DOTNET_ROOT.
The testhost.exe DOTNET_ROOT issue is now fixed in Test.csproj by excluding build assets. Removed diagnostic echo commands, DotNetSdkRoot property, and EnvironmentVariables workaround that are no longer needed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Context
Explain the context or motivation behind this PR. Include links to any related Azure DevOps Work Items or GitHub issues.
📌 How to link to ADO Work Items
Description
Provide a concise summary of the changes introduced in this PR.
Risk Assessment (Low / Medium / High)
Assess the risk level and justify your assessment. For example: code path sensitivity, usage scope, or backward compatibility concerns.
Unit Tests Added or Updated (Yes / No)
Indicate whether unit tests were added or modified to reflect the changes.
Additional Testing Performed
List manual or automated tests performed beyond unit tests (e.g., integration, scenario, regression).
Change Behind Feature Flag (Yes / No)
Can this change be behine feature flag, if not why?
Tech Design / Approach
Documentation Changes Required (Yes/No)
Indicate whether related documentation needs to be updated.
Logging Added/Updated (Yes/No)
Telemetry Added/Updated (Yes/No)
Rollback Scenario and Process (Yes/No)
Dependency Impact Assessed and Regression Tested (Yes/No)