Description
Sdk style MSBuild projects support generating assembly attributes via properties.
The 'heavy lifting' for this feature is in the WriteCodeFragment
task. This task was added as a general MSBuild task. It is not specific to Microsoft.NET.Sdk
and it is available to Legacy projects that are using a current version of MSBuild.
What is missing in Legacy projects is support for the related properties, and invoking the task before compile. It seems like a back port of these 'missing' pieces could be small in scope and side effects.
Not every code base is ready to move from Legacy style projects. There are lots of questions and discussions online about versioning. The GenerateAssemblyInfo
feature is a big improvement for handling versioning that Legacy projects would benefit from. (Some developers have custom back ported or otherwise replicated the GenerateAssemblyInfo
feature.) Additionally, for a build system, the approach to versioning could be consistent across Legacy and Sdk projects. (This could be an aid to migrating away from Legacy projects.)
For Legacy projects the default value of GenerateAssemblyInfo
would need to be false
to avoid conflicting with existing AssemblyInfo.cs
files. There would need to be documentation that if GenerateAssemblyInfo
to set to true
, attributes set by properties need to be removed from the AssemblyInfo.cs
file.