简体   繁体   English

C# 中未找到组装信息

[英]Assembly information not found in C#

I'm looking to change my assembly and file version like this我希望像这样更改我的程序集和文件版本在此处输入图像描述

However, in my new project this does not appear但是,在我的新项目中,这并没有出现在此处输入图像描述

I also tried to add it directly to the AssemblyInfo.cs file but it created a duplicate error.我还尝试将其直接添加到 AssemblyInfo.cs 文件中,但它产生了重复错误。 在此处输入图像描述

.NET Core projects don't support this dialog anymore. .NET 核心项目不再支持此对话框。 Edit your project file instead.改为编辑您的项目文件。

If you want to add your own assembly attributes, check this already answered question here: https://stackoverflow.com/a/42183749/7972419如果您想添加自己的程序集属性,请在此处查看已回答的问题: https://stackoverflow.com/a/42183749/7972419

The AssemblyInfo.cs is not included in the default templates anymore because SDK-style project type supports setting this kind of information within the csproj file. AssemblyInfo.cs不再包含在默认模板中,因为 SDK 样式的项目类型支持在csproj文件中设置此类信息。

You have a couple of options for doing this:你有几个选项可以做到这一点:

  1. You could set the Version property of your assembly within your project file.您可以在项目文件中设置程序集的Version属性。 For example:例如:

    netcoreapp3.0 1.2.3 netcoreapp3.0 1.2.3
  2. Another option is to set it during the build process - dotnet build /p:Version=1.2.3 .另一种选择是在构建过程中设置它 - dotnet build /p:Version=1.2.3

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM