Cannot get assembly version for footer

前端 未结 4 1462
北荒
北荒 2021-02-02 08:43

I\'m using the automatic build versioning mentioned in this question (not the selected answer but the answer that uses the [assembly: AssemblyVersion(\"1.0.*\")] te

4条回答
  •  攒了一身酷
    2021-02-02 09:22

    If you already have Global.asax in place, it could be a good place to store version globally once.

    Global.asax.cs:

    public class Global : HttpApplication
    {
        public static readonly Version Version = Assembly.GetExecutingAssembly().GetName().Version;
    }
    

    Your view:

    - Version: @YourNamespace.Global.Version

提交回复
热议问题