The temporary project that dotnet tool restore
generates emits a bunch of flags that clears out some SDK default behavior: https://github.com/dotnet/toolset/blob/master/src/dotnet/ToolPackage/ToolPackageInstaller.cs#L189-L196. In addition to this, it should also avoid importing Directory.Build.props and targets.
<ImportDirectoryBuildProps>false</ImportDirectoryBuildProps>
<ImportDirectoryBuildTargets>false</ImportDirectoryBuildTargets>
This would mirror the behavior of deps file generation: https://github.com/dotnet/sdk/blob/master/src/Tasks/Microsoft.NET.Build.Tasks/targets/GenerateDeps/GenerateDeps.proj#L25-L28
Background:
ASP.NET Core has a Directory.Build.props targets at the root of the repo. We recently retarted the TempDir to point to a sub dir of the root. This caused dotnet tool restore
's temporary project file to pick up these props and targets resulting in build failures.
/cc @tmat
@wli3
Totally reasonable.
Most helpful comment
Totally reasonable.