A Version # in a website in .Net 2.0.

M

Mufasa

Is there any way to get a version number of a web site? I used
System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()
in 1.1 and it seemed to return a version number. When I do that in 2.0, it
always returns 1.0.0.0. The version # isn't really important, I just want
to keep track of when changes happen. I suppose I could even do something
like compile time.

So is there anyway to tell the date/time when a file was compiled ?

TIA - Jeff.
 
J

John Saunders [MVP]

Mufasa said:
Is there any way to get a version number of a web site? I used
System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()
in 1.1 and it seemed to return a version number. When I do that in 2.0, it
always returns 1.0.0.0.

If it returns 1.0.0.0, then that's the version number.

I believe that the version number can be set from the property pages of the
web site. I don't use web sites (I use web application projects instead),
but I think there's an "Assembly" button.
 
J

Juan T. Llibre

re:
I believe that the version number can be set from the property pages of the web site.

That can be done if WDP is used.
It can't be done with a standard VS 2005 project.
 
J

Juan T. Llibre

Web Deployment Projects.

http://msdn2.microsoft.com/en-us/library/aa479568.aspx

Version Output Assemblies

Sets the assembly version and/or the file version attribute of merged assemblies.

This setting overrides the assembly attributes defined
in the AssemblyInfo.vb or AssemblyInfo.cs file in the App_Code directory.

See :
http://msdn2.microsoft.com/en-us/asp.net/aa336619.aspx

The WDP setup files are available at :
http://download.microsoft.com/downl...4043-bb70-bc841e27f13c/WebDeploymentSetup.msi

You can also do it with aspnet_merge.exe :

http://msdn2.microsoft.com/en-us/library/aa479044.aspx

....if you add an Assemblyinfo file to the App_Code directory before running aspnet_merge.

To mark the merged assembly with the attributes defined for the App_Code assembly, use
the -copyattrs option.
 
M

Mufasa

Actually turns out I found it. In the AssemblyInfo file it had actually set
the version to 1.0.0.0 - I changed it to 1.0.* and now the version shows up
correctly.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,231
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top