dotnet / dotnet/project-system

When a project has failed imports, no targets should be run

Open
#5,554 0 comments 0 reactions 0 assignees View on GitHub
Triage-Approved
Dominant language
C#
Stars
1k
Forks
415
PR merge metrics
No merged PRs in 30d

Description

See repro steps in https://github.com/dotnet/arcade/issues/2377

Historically, a failed import in the project file would prevent the project from loading. At some point CPS started skipping the imports and loading the project nonetheless. When in this state, running targets can have unwanted side effects. In the linked repro, output directories are not configured correctly due to failed imports and then the design time build causes intermediate files to be written all over the tree. The side effects could be anything else. Authors of msbuild logic cannot reasonably defend against an import they have having just been skipped. It should be considered incorrect/unsafe to run targets in this state.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.