//
you're reading...
ASP.NET, IT-Center, Web Based

ASP.NET Web Site Compile Using DLL Version

Why Using DLL Version, are understand version like 1.0.0.0? Version Numbe help you to understand when last breakdown of software release. ASP.NET can read assembly version (dll file) in Web Project, but in Web Site ASP.NET can read app_code.dll assembly version.

STEP 1. ASSEMBLY VERSION
1. Create New Website from Visual Studio 2005. File > New > Web Site >
2. Write Assembly File

create new folder App_Code, create new item class, clear all text and fill with :

<assembly:System.Reflection.AssemblyVersionAttribute("versionNumber")>

To create an assembly-information file for your application

  1. Using a text editor, create a new assembly-information file. For Visual Basic applications, the suggested file name is AssemblyInfo.vb. For C# applications, the suggested file name is AssemblyInfo.cs.
  2. Add the following code to the assembly-information file.
    <assembly:System.Reflection.AssemblyVersionAttribute("versionNumber")>

To specify the assembly-information file in your .aspx page

  1. Open your .aspx file in a text editor.
  2. Add the following attribute to the @ Page directive in the .aspx page.
    CompilerOptions="path\AssemblyInfo.vb"

    Replace the path parameter with the physical path to the assembly-information file on disk.

    If the path to your assembly-information file contains spaces, you must enclose the path and file name in single quotation marks (‘).

    CompilerOptions='"path with spaces\AssemblyInfo.vb"'

    C#

     CompilerOptions='"path with spaces\AssemblyInfo.cs"'Replace the path with spaces parameter with the physical path to the assembly-information file on disk.

    3. Compile your application for deployment. For more information, see How to: Precompile ASP.NET Web Site Projects for Deployment.

    To specify the assembly-information file in your Web.config file

    1. Open your Web.config file in a text editor.
    2. Add the following code to your Web.config file.
      <system.codedom>
        <compilers>
          <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
            type="Microsoft.VisualBasic.VBCodeProvider, System,
            Version=2.0.3600.0, Culture=neutral,
            PublicKeyToken=b77a5c561934e089"
            compilerOptions="path\AssemblyInfo.vb" />
        </compilers>
      </system.codedom>
    3. Compile your application for deployment. For more information, see How to: Precompile ASP.NET Web Site Projects for Deployment.

STEP 2. SHOW VERSION NUMBER 
Assumtion in Page aspx have Label lbVersion

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

 Dim ver As String = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()
 lbVersion.Text = "Ver. " & ver
 lbVersion.ForeColor = Drawing.Color.White

 End Sub

STEP 3. COMPILE THE WEB SITE

aspnet_compiler -p "C:\MyDevelopment\WebSite1" -v / C:\Staging

See Also : 
http://odetocode.com/code/417.aspx
http://msdn.microsoft.com/en-us/library/ms229863(v=vs.80).aspx

C:\windows\microsoft.net\framework\v2.0.50727\ aspnet_compiler –v “Virtual Directory Name” –p “ <path source folder> ” “ <path folder destination> ”  <error>


About berbagisolusi

Berbagi merupakan sebuah bentuk simbol keikhlasan untuk membantu dan menolong, sedangkan solusi adalah cara menyelesaikan masalah. Setiap manusia pasti mengalami masalah, tetapi kita tidak perlu mengalami masalah yang sama jika orang lain pernah mengalami dan kita tahu hal tersebut.

Discussion

3 thoughts on “ASP.NET Web Site Compile Using DLL Version

  1. I visit everyday some sites and information sites to
    read articles, but this weblog presents feature
    based posts.

    Posted by casas de apostas | April 14, 2014, 9:49 am
  2. I quite like looking through a post that will make people think.

    Also, thanks for allowing for me to comment!

    Posted by Isaac | August 1, 2014, 7:11 pm
  3. Hey there Your entire web site starts up seriously slow to me, I am not
    sure who’s issue is that although twitter and facebook starts really fast.
    Well, I’d like to thank you very much for putting amazing content.
    I’m sure this has already been totally beneficial to individual who seem to
    visit here. This is without a doubt fantastic what you
    actually have implemented here and wish to check out
    content from you. I already have your site book-marked to check blogs you publish.

    Posted by www.fifaworldhacks.com | July 13, 2015, 1:05 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 9 other followers

December 2011
M T W T F S S
« Nov   Jan »
 1234
567891011
12131415161718
19202122232425
262728293031  

Archives

Web Statistic

Blog Stats

  • 149,580 hits
%d bloggers like this: