-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Analyzers prototyping - properly inject bootstrap location into tests #9729
Copy link
Copy link
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Fields
Give feedbackNo fields configured for issues without a type.