简体   繁体   English

.NET DLL中的版本不反映生成或修订

[英]Version in .NET DLL not reflecting Build or Revision

Using C# in Visual Studio 2012 ... 在Visual Studio 2012中使用C#...

  • I build my assembly in either Debug or Release mode. 我以调试或发布模式构建程序集。
  • I right-click on the properties of the newly created DLL in the bin/debug or bin/release folder and choose " properties ". 我右键单击bin / debugbin / release文件夹中新创建的DLL的属性,然后选择“ properties ”。
  • On the " details " tab I look at the File and Product Version properties and see the following ... 在“ 详细信息 ”选项卡上,我查看“文件”和“产品版本”属性,并看到以下内容...

    File Version 1.0.0.0 档案版本1.0.0.0

    Product Version 1.0.* 产品版本1.0。*

AssemblyInfo.cs defines versions as such ... AssemblyInfo.cs定义了这样的版本...

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

I was expecting, when I looked at the DLL properties something like ... 我期待着,当我查看DLL属性时,...

File Version    1.0.3.19514
Product Version 1.0.3.19514

Is there some reason why the build and revision numbers are not being automatically set as it seems ALL the documentation in the world would indicate that they should? 为什么没有自动设置内部版本号和修订版本号,因为世界上所有文档都表明应该如此?

I have no doubt that this is a brain-fart on my part. 我毫不怀疑,这是我的脑筋。 :| :|

Thanks 谢谢

If you use an asterisk in your assemblyinfo.cs file in place of the Build Number then you are telling Visual Studio to apply its rules in calculating the Build Number and the Revision Number . 如果在assemblyinfo.cs文件中使用星号代替内部版本号,则您要告诉Visual Studio在计算内部 版本号修订版号时应用其规则。 At compile time VS doesn't change the asterisk to the actual values stored in the assembly so, at the next compilation it can repeat the process. 在编译时,VS不会将星号更改为程序集中存储的实际值,因此,在下一次编译时,它可以重复该过程。

The current rules about Versioning in VS are explained in the AssemblyVersionAttribute page on MSDN 有关VS中版本控制的当前规则,请参见MSDN上的AssemblyVersionAttribute页面。

And, shortly, they are saying 而且,不久之后,他们说

The default build number increments daily. 默认内部版本号每天递增。 The default revision number is the number of seconds since midnight local time (without taking into account time zone adjustments for daylight saving time), divided by 2. 默认修订版号是自当地时间午夜以来的秒数(不考虑夏令时的时区调整)除以2。

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

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