Results 1 to 3 of 3

Thread: Get a Version number for an ASP Project/Assembly??

  1. #1

    Thread Starter
    Lively Member tgoodmannz's Avatar
    Join Date
    Sep 2000
    Location
    Mid On at the Pavillion End
    Posts
    102

    Get a Version number for an ASP Project/Assembly??

    Hi,

    Is it possible to get a version number for an ASP.NET project or Assembly?

    I know that ASP.NET assigns my project a version number - it can be specified in AssemblyInfo.vb. I can also see it in the project.dll that gets created.

    My question is how can I access it at runtime (to display/reference)

    I thought I might be able to access it via:

    Code:
    System.Reflection.Assembly.Version
    or similar, but I can't seem to get it.

    Any ideas??

    Thanks,
    Tim

  2. #2
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    Try this
    Code:
    Assembly asm;
    asm = Assembly.GetExecutingAssembly();
    Response.Write(asm.GetName().Name + " " + asm.GetName().Version.Major + "." + asm.GetName().Version.Minor + "." + asm.GetName().Version.Build);

  3. #3

    Thread Starter
    Lively Member tgoodmannz's Avatar
    Join Date
    Sep 2000
    Location
    Mid On at the Pavillion End
    Posts
    102
    Thanks DevGrp,

    I had to tweak it to run in VB .. for the record here is the code:

    Code:
            Dim asm As System.Reflection.Assembly
            asm = System.Reflection.Assembly.GetExecutingAssembly()
            mClientCL.UPAlert(asm.GetName().Name & " " & _  
                    asm.GetName().Version.Major & "." & asm.GetName().Version.Minor & "." & _
                    asm.GetName().Version.Build & "." & asm.GetName().Version.Revision)
    Tim

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width