-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
Description
Context
Goals
Tha sample unit test works properly regardless of the curent target FW and configuration and regardless of how/where we place our bootstrap binaries.
Current code:
msbuild/src/UnitTests.Shared/RunnerUtilities.cs
Lines 42 to 50 in 9fb9f56
| // TODO: use proper way of passing the bootsrtrap location: https://github.com/dotnet/msbuild/issues/9729 | |
| string basePath = PathToCurrentlyRunningMsBuildExe.Substring(0, PathToCurrentlyRunningMsBuildExe.IndexOf(@"artifacts\bin", StringComparison.InvariantCultureIgnoreCase)); | |
| #if NET | |
| string pathToExecutable = EnvironmentProvider.GetDotnetExePath(); | |
| msbuildParameters = Path.Combine(basePath, @"artifacts\bin\bootstrap\net8.0\MSBuild\msbuild.dll") + " " + msbuildParameters; | |
| #else | |
| string pathToExecutable = | |
| Path.Combine(basePath, @"artifacts\bin\bootstrap\net472\MSBuild\Current\Bin\amd64\msbuild.exe"); | |
| #endif |
Proper way - the bootstrap location from the build script is passed via property into the compiled test binary and hence proper location is used