[Feature Request]: Back port GenerateAssemblyInfo from Sdk projects to Legacy projects
- Dominant language
- C#
- Stars
- 5.5k
- Forks
- 1.5k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 141
Description
Sdk style MSBuild projects support generating [assembly attributes](https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#assembly-attribute-properties) via properties.
The 'heavy lifting' for this feature is in the [`WriteCodeFragment` task](https://learn.microsoft.com/en-us/visualstudio/msbuild/writecodefragment-task?view=vs-2022). 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.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.