devxlogo

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

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:MyAppMyAssembly.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 asmEnd Function

See also  Monetize TikTok For Your Business
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist