Add a warning to help users diagnose a scenario where setting assembly properties is getting "ignored".
Background and Motivation
As a scenario: a large legacy solution has been migrated to the .SDK format, and in some obscure project(s) a previous developer has set GenerateAssemblyInfo to False so that an AssemblyInfo.cs file is being used.
At a later time a different developer sets Assembly-related properties via dotnet/msbuild CLI args or Directory.Build.props, and cannot figure out why those properties are getting ignored for some projects. There's no warning printed to the command line, and even creating a binlog and loading it into the binlog viewer doesn't give any hints about why the property settings are getting "ignored" for those assemblies.
Proposed Feature
If GenerateAssemblyInfo is false, then emit a warning if any pack-target properties are set.
(I suppose this would also apply to any of the individual GenerateAssembly*Attribute properties, but that might be getting into pretty rare scenarios 🤷)
Summary
Add a warning to help users diagnose a scenario where setting assembly properties is getting "ignored".
Background and Motivation
As a scenario: a large legacy solution has been migrated to the .SDK format, and in some obscure project(s) a previous developer has set
GenerateAssemblyInfo
to False so that an AssemblyInfo.cs file is being used.At a later time a different developer sets Assembly-related properties via dotnet/msbuild CLI args or Directory.Build.props, and cannot figure out why those properties are getting ignored for some projects. There's no warning printed to the command line, and even creating a binlog and loading it into the binlog viewer doesn't give any hints about why the property settings are getting "ignored" for those assemblies.
Proposed Feature
If
GenerateAssemblyInfo
is false, then emit a warning if any pack-target properties are set. (I suppose this would also apply to any of the individual GenerateAssembly*Attribute properties, but that might be getting into pretty rare scenarios 🤷)Alternative Designs
?