Cannot get assembly version for footer

前端 未结 4 1453
北荒
北荒 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:15

    You can:

    e.g in your Application_Start method in Global.asax file add

    protected void Application_Start(object sender, EventArgs e)
    {
        HttpContext.Current.Application.Add("Version", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString());
    }
    

    in HTML show it by

    <% =HttpContext.Current.Application["Version"].ToString() %>

    ALSO Change Assembly version to 1.0.0.* by going to - Project properties > Application > Assembly Information and assembly version is shown as 1.0.0.0 - change it to 1.0.0.*

    this will give you some versioning

提交回复
热议问题