You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a "Microsoft.NET.Sdk" project defines a TargetFrameworks property instead of a TargetFramework property (effectively activating the multi-targeting behavior), it no longer imports Directory.Build.targets in the top-level evaluation.
When a TargetFramework is set, it imports both Directory.Build.props and Directory.Build.targets.
But when only TargetFrameworks is defined, it only imports Directory.Build.props.
This distinction is very subtle and unexpected. It took me quite some time to diagnose a build issue before I figured this out. I trust this was an unintentional oversight that can be fixed.
When a "Microsoft.NET.Sdk" project defines a
TargetFrameworks
property instead of aTargetFramework
property (effectively activating the multi-targeting behavior), it no longer importsDirectory.Build.targets
in the top-level evaluation.When a
TargetFramework
is set, it imports both Directory.Build.props and Directory.Build.targets.But when only
TargetFrameworks
is defined, it only importsDirectory.Build.props
.This distinction is very subtle and unexpected. It took me quite some time to diagnose a build issue before I figured this out. I trust this was an unintentional oversight that can be fixed.
Repro project:
dirprops.zip
When building the
Restore
target, I see this:But when I define
TargetFramework
I see both targets executing:The text was updated successfully, but these errors were encountered: