dcsimg
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: VB7
Expertise: Intermediate
Dec 15, 2003

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


LoadAssembly - Loading an assembly identified by the path or the partial name

' Load an assembly identified by the path or the partial name
' Note: requires Imports System.Reflection
' 
' Examples:
'   1) Dim asm As [Assembly] = LoadAssembly("System.Web")
'   2) Dim asm As [Assembly] = LoadAssembly("C:\MyApp\MyAssembly.dll") 

Function LoadAssembly(ByVal asmFile As String) As [Assembly]
    Dim asm As [Assembly]
    Try
        ' attempt to load the assembly from a path
        asm = [Assembly].LoadFile(asmFile)
    Catch ex As Exception ' ignore exceptions
    End Try

    Try
        ' attempt to load an assembly with this (partial) name
        If asm Is Nothing Then
            asm = [Assembly].LoadWithPartialName(asmFile)
        End If
    Catch ex As Exception ' ignore exceptions
    End Try

    ' return whatever we have found so far
    Return asm
End Function
Francesco Balena
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date