0

We have a very old legacy VB.Net ASPX WebSite, not Web App, and I am trying to implement simple versioning. Either auto increment or manual as it doesn't matter.

So far I have tried putting the AssemblyInfo.vb file in the root folder and in the App_Code folder.

Then i have tried various implementations of the following;

Dim versionNumber As Version
versionNumber = Assembly.GetExecutingAssembly().GetName().Version

This only ever return 0.0.0.0.

I have also used;

Dim a As String = Assembly.GetAssembly(GetType(Business.EmailHelper)).GetName().Version.ToString()

The latter gets me a version as I am targeting a class library that has AssemblyInfo.vb in it.

I just can't seem to get the same for the WebSite.

Where do I place the AssemblyInfo.vb file in the WebSite so that I can read the version information?

Thanks.

griegs
  • 22,624
  • 33
  • 128
  • 205

1 Answers1

0

To version the assembly for an ASP.Net Website project you need to precompile it. You also need to include the AssemblyInfo.vb either via a Page directive or the Web.config file. MSDN article on it here.

neo mouse
  • 51
  • 3