Retrieving Assembly Version?

Discussion in 'ASP .Net' started by Rob Meade, Jul 20, 2006.

  1. Rob Meade

    Rob Meade Guest

    Hi all,

    I have some code which we use to retrieve an assembly version of a
    referenced assembly in our proects, this information is displayed in our
    footer part of our template.

    I've just started writing some Server Controls as opposed to Web User
    Controls and it would seem that it is retrieving the assembly version from
    the referenced assembly in the "control" rather than the web application...

    Here's the code:

    Private Function GetCCLVersion(ByRef cclVersion As Version) As Boolean
    Dim origAssembly As [Assembly]
    Dim foundCCL As Boolean
    Dim references As AssemblyName()
    Dim currentReference As AssemblyName

    cclVersion = Nothing

    Try

    origAssembly = [Assembly].GetExecutingAssembly
    references = origAssembly.GetReferencedAssemblies()

    For Each currentReference In references

    If (currentReference.Name.ToLower = "ubhtcommonclasses") Then

    cclVersion = currentReference.Version
    foundCCL = True
    Exit For

    End If

    Next

    Catch ex As Exception

    End Try

    Return (foundCCL)

    End Function

    Can anyone tell me how I retrieve this information from the main web
    application, I've tried using "GetCallingAssembly" but it seems to make no
    difference...

    Any info appreciated..

    Regards

    Rob
    Rob Meade, Jul 20, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Prasanna Padmanabhan
    Replies:
    1
    Views:
    800
    Mattias Sjögren
    Nov 19, 2003
  2. Eidolon
    Replies:
    0
    Views:
    1,976
    Eidolon
    Jun 26, 2003
  3. V Green
    Replies:
    0
    Views:
    823
    V Green
    Feb 5, 2008
  4. PA Bear [MS MVP]
    Replies:
    0
    Views:
    929
    PA Bear [MS MVP]
    Feb 5, 2008
  5. MowGreen [MVP]
    Replies:
    5
    Views:
    1,993
    PA Bear [MS MVP]
    Feb 9, 2008
Loading...

Share This Page