Sdk: Project file generated by dotnet tool restore should avoid importing Directory.Build.props and Directory.Build.targets

Created on 30 Jan 2020  路  3Comments  路  Source: dotnet/sdk

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.

Most helpful comment

Totally reasonable.

All 3 comments

/cc @tmat

@wli3

Totally reasonable.

Was this page helpful?
0 / 5 - 0 ratings