gpt4 book ai didi

.net - CS1607 : The version specified for the 'file version' is not in the normal 'major.minor.build.revision' format in . 网络

转载 作者:行者123 更新时间:2023-12-02 09:26:33 25 4
gpt4 key购买 nike

我正在尝试在项目中设置我的 AssemblyVersionAssemblyFileVersion 属性,如下所示:

[assembly: AssemblyVersion("3.0.*")]
[assembly: AssemblyFileVersion("3.0.*")]

但我收到此警告:

CS1607: Assembly generation -- The version '3.0.*' specified for the 'file version' is not in the normal 'major.minor.build.revision' format

AssemblyVersionAttribute Class 页面上 MSDN如下:

You can specify all the values or you can accept the default build number, revision number, or both by using an asterisk (*). For example, [assembly:AssemblyVersion("2.3.25.1")] indicates 2 as the major version, 3 as the minor version, 25 as the build number, and 1 as the revision number. A version number such as [assembly:AssemblyVersion("1.2.*")] specifies 1 as the major version, 2 as the minor version, and accepts the default build and revision numbers. A version number such as [assembly:AssemblyVersion("1.2.15.*")] specifies 1 as the major version, 2 as the minor version, 15 as the build number, and accepts the default revision number.

注意粗体部分。有谁知道为什么 [ assembly: AssemblyVersion("3.0.*")] (来 self 的项目)无效,但是 [assemble:AssemblyVersion("1.2.*")](来自 MSDN 示例)有效吗?

特别是,我很好奇是否可以从非零主编号开始,因为我正在编写的应用程序是该程序的版本 3。

更新>>> 抱歉,这似乎在另一篇文章中得到了回答...请投票关闭它,谢谢。

最佳答案

您假设问题出在这一行:

[assembly: AssemblyVersion("3.0.*")]

当它实际上与这个一起时:

[assembly: AssemblyFileVersion("3.0.*")]

喜欢the accepted answer to the question that you say is not a duplicate of this one说:

For the AssemblyFileVersionAttribute you cannot use the * special character so you have to provide a full and valid version number.

* 语法AssemblyVersion 属性一起使用。它不适用于 AssemblyFileVersion 属性。

有两种解决方法可以实现您可能想要的结果:

  1. 只需完全省略 AssemblyFileVersion 属性即可。这将导致程序集文件版本信息自动从 AssemblyVersion 属性(该属性确实支持 * 语法)中获取。

  2. 拿出大枪并安装 Build Version Increment add-in ,它为您提供了更多的版本增量选项,超出您的想象。

关于.net - CS1607 : The version specified for the 'file version' is not in the normal 'major.minor.build.revision' format in . 网络,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15505841/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com