try resolve msbuild.exe before guessing it
- Dominant language
- C#
- Stars
- 4.2k
- Forks
- 778
- Avg merge
- 1h 15m
- Merged PRs (30d)
- 19
Description
```C#
#tool nuget:?package=vswhere
...
Setup(context =>
{
var msbuildToolsPath = VSWhereProducts("*", new VSWhereProductSettings { Requires = "Microsoft.Component.MSBuild"})
.FirstOrDefault()
?.CombineWithFilePath(@".\MSBuild\15.0\Bin\MSBuild.exe")
;
context.Tools.RegisterFile(msbuildToolsPath);
});
…
Task("Build-Solution")
.Does(() =>
{
MSBuild(solutionPath, settings =>
{
settings
.SetConfiguration(configuration)
.WithTarget("Restore")
.WithTarget("Rebuild")
.WithTarget("Pack")
;
});
});
```
The script above doesn't work because the `MSBuildRunner` doesn't provide a list of executable names to be resolved.
https://github.com/cake-build/cake/blob/main/src/Cake.Common/Tools/MSBuild/MSBuildRunner.cs#L284-L287
Contributor guide
Assessment
This issue has not been assessed yet.