471,071 Members | 5,794 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,071 software developers and data experts.

Version of the code behind Assembly

In ASP.NET 1.1 I used to retreive the version of my code-behind assembly
using following syntax:
Assembly.GetExecutingAssembly().GetName().Version
The version was defined in AssemblyInfo.cs using
[assembly: AssemblyVersion("1.10.*")]

After migrating to ASP.NET 2.0 this line of code always return 0.0.0.0. How
do I retreive the assembly version of ASP.NET application?

Thanks
Jan 23 '06 #1
1 1909
Hi Andrewb,

Welcome to ASPNET newsgroup.
Regarding on the querying asp.net 2.0 web application's assembly version
problem it is actually due to the new compilation model of ASP.NET 2.0 web
application and vs 2005 website project. In ASP.NET 2.0 and vs 2005, we no
longer have a precompiled assembly (dll) in the "bin" dir for the
application's code behind classes or any other component classes... ,
instead it make those classes be dynamically compiled at runtime or fully
precompiled at deployment time(if we use the publish web site in vs 2005 or
use aspnet_compiler.exe command line tool).... So when we use
Assembly.GetExecutingAssembly().GetName().Version

it is actually querying the dynamic compiled assembly's version which will
be 0.0.0.0 ..... You can also find some other threads and article in
newsgroup or web forum indicating this.

Currently, since we did receive many customers and community members's
feedback on the old project assembly and compilation model, the ASP.NET
team is about to provide two new project type , one is for web
application's deployment, which can help do some customization on the final
precompiled assembly, such as apply version number or strong-name ...

And another project is used for provide the ASP.NET 1.1/VS2003 like project
type which will let us compiled a single main assembly for each web
application. Here are the links to their beta preview site on msdn center:

#Visual Studio 2005 Web Application Projects (Beta Preview)
http://msdn.microsoft.com/asp.net/re...p/default.aspx
#Visual Studio 2005 Web Deployment Projects (Beta Preview)
http://msdn.microsoft.com/asp.net/re...p/default.aspx

Hope helps. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| Thread-Topic: Version of the code behind Assembly
| thread-index: AcYga9vfI831AFxyTGGe4U+2CCvIvQ==
| X-WBNR-Posting-Host: 68.148.0.205
| From: =?Utf-8?B?QW5kcmV3?= <an*****@community.nospam>
| Subject: Version of the code behind Assembly
| Date: Mon, 23 Jan 2006 14:25:04 -0800
| Lines: 10
| Message-ID: <54**********************************@microsoft.co m>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:372990
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| In ASP.NET 1.1 I used to retreive the version of my code-behind assembly
| using following syntax:
| Assembly.GetExecutingAssembly().GetName().Version
| The version was defined in AssemblyInfo.cs using
| [assembly: AssemblyVersion("1.10.*")]
|
| After migrating to ASP.NET 2.0 this line of code always return 0.0.0.0.
How
| do I retreive the assembly version of ASP.NET application?
|
| Thanks
|

Jan 24 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

171 posts views Thread by tshad | last post: by
1 post views Thread by javatopia | last post: by
8 posts views Thread by schaf | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.