How to specify the assembly version for a .NET Core project?

后端 未结 2 715
伪装坚强ぢ
伪装坚强ぢ 2021-01-11 09:25

I noticed in new .NET Core projects there is no AssemblyInfo.cs file created. I have seen that you can still set assembly attributes such as AssemblyVersi

2条回答
  •  佛祖请我去吃肉
    2021-01-11 10:04

    Reasons for still using an AssemblyInfo.cs file might include

    1. you want to share some of the AssemblyInfo across projects, which you can do with a file
    2. you might have a code-generation process that spits out the assemblyinfo
    3. the project file format doesn't yet support all the attributes you might want to use. The project Sdk knows how to auto-generate a limited set of [AssembyAttributes] from Xml Elements with matching names in the csproj file, but it doesn't support autogeneration of arbitrary [AssembyAttributes] or other metadata for your assembly.
    4. AssemblyInfo.cs is “just” a source code file, you might have other metadata – whether AssemblyAttributes or classes or other – you want to keep all in one easily found place.

提交回复
热议问题