Retrieving Assembly Version?

R

Rob Meade

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
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top