How can I display the Build number and/or DateTime of last build in my app?

前端 未结 1 593
有刺的猬
有刺的猬 2020-12-17 10:05

I know that I can do this to get the app\'s official (release/publish) version number:

string version = Assembly.GetExecutingAssembly().GetName().Version.ToS         


        
相关标签:
1条回答
  • 2020-12-17 10:23

    The value returned from Assembly.GetExecutingAssembly().GetName().Version is that in your project's AssemblyInfo.cs file:

    [assembly: AssemblyVersion("1.0.0.0")]
    

    Modify these before a build to specify the value it returns. Or, as documented in the same AssemblyInfo.cs file:

    // Version information for an assembly consists of the following four values:
    //
    //      Major Version
    //      Minor Version 
    //      Build Number
    //      Revision
    //
    // You can specify all the values or you can default the Build and Revision Numbers 
    // by using the '*' as shown below:
    // [assembly: AssemblyVersion("1.0.*")]
    
    0 讨论(0)
提交回复
热议问题