Do I need AssemblyInfo while working with .NET Core?

前端 未结 2 516
暗喜
暗喜 2021-02-04 00:03

Previously, AssemblyInfo.cs file was autocreated by Visual Studio to contain assembly-wide attributes, like AssemblyVersion, AssemblyName and so on.

In .NET

2条回答
  •  执念已碎
    2021-02-04 00:14

    The project.json is not a direct replacement for the AssemblyInfo.cs, so there is still the need if you want to define some values you cannot provide in the project.json.

    From the Issue https://github.com/aspnet/dnx/issues/2715 you can see, that in the beginning some parameters, like title, description, copyright, etc. where taken to fill the fields for the generated nuget packages. With the issue 2715 the idea was born, that these values can "flow into the Assembly". So that you have not to configure these fields in two different places. So if you do not want to configure more than these paramters, the the AssemblyInfo.cs is not needed.

    There are other fields like [InternalsVisibleTo] that can not be configured in project.json. So there are cases where there is still the need to define one.

提交回复
热议问题