我在Visual Studio 2015中有一个旧的“网页”项目,正在尝试将版本添加到其中。我在app_code文件夹下创建了assemblyinfo.vb文件,其中包含以下内容…
Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
' General Information about an assembly is controlled through the following
' set of attributes. Change these attribute values to modify the information
' associated with an assembly.
' Review the values of the assembly attributes
<Assembly: AssemblyTitle("MyWebSite")>
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("MyWebSite")>
<Assembly: AssemblyCopyright("Copyright © MyCompany 2018")>
<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)>
' 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.*")>
<Assembly: AssemblyVersion("1.2.3.4")>
<Assembly: AssemblyFileVersion("1.2.3.4")>
在我的网站上我有一个template.master,它引用了…
<asp:Literal runat="server" ID="Version"></asp:Literal>
在我的网站上,我还有一个template.master.vb,其中包含…
Dim assembly As Assembly = Assembly.Load("App_Code")
Dim ver As Version = assembly.GetName().Version
Version.Text = "Version: " + ver.Major.ToString() + "." + ver.Minor.ToString() + "." + ver.Revision.ToString() + " build (" + ver.Build.ToString() + ")"
现在,当我构建我的站点时,它看起来和我预期的完全一样,如下所示…
版本:1.2.4版本(3)
现在我已经有了所有的设置,我希望在Visual Studio中得到一个我最喜欢的扩展来帮助我更新每个构建的版本。我已经设置好了,所以我有以下内容…
它看起来很好,就像我在其他项目中设置的一样,我已经确认了到组件的路径是100%正确的等等。
出于某种原因,当我构建或发布网页时,它将永远不会更新版本。甚至自动版本日志也是空白的。你知道我做错了什么吗?