简体   繁体   中英

Version in .NET DLL not reflecting Build or Revision

Using C# in Visual Studio 2012 ...

  • 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 ".
  • On the " details " tab I look at the File and Product Version properties and see the following ...

    File Version 1.0.0.0

    Product Version 1.0.*

AssemblyInfo.cs defines versions as such ...

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

I was expecting, when I looked at the DLL properties something like ...

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 . 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.

The current rules about Versioning in VS are explained in the AssemblyVersionAttribute page on MSDN

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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