Project file generated by dotnet tool restore should avoid importing Directory.Build.props and Directory.Build.targets
See original GitHub issueThe 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.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:5 (3 by maintainers)
Totally reasonable.
Is Directory.Build.rsp likewise used? If so, should it be suppressed?