Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Load methods from dll dynamically in application

Load methods from dll dynamically in application

Scheduled Pinned Locked Moved .NET (Core and Framework)
helpquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pdnet
    wrote on last edited by
    #1

    Hi I'm Creating a DLL File "Fr6Customise.dll" and Code is Imports System Namespace Fr6Customise Public Class LoadModule Public Shared Function ViewModule() As Boolean Return True End Function End Class End Namespace ---------------------------------------- Now I am using that dll in my project whenever needed... Dim CAssembly As Assembly = Assembly.LoadFrom(My.Application.Info.DirectoryPath & "\" & "FR6Customise.dll") Dim scriptType As Type = CAssembly.GetType("Fr6Customise. LoadModule") Dim mi As MethodInfo = scriptType.GetMethod("ViewModule") But, when I am using this Code scriptType always return Nothing. There is any error found in this Code. How Can I Solevd It. Pl, Help me.

    Arindam Banerjee Sr. Software Developer Rance Computer Pvt Ltd. Kolkata (India)

    E 1 Reply Last reply
    0
    • P pdnet

      Hi I'm Creating a DLL File "Fr6Customise.dll" and Code is Imports System Namespace Fr6Customise Public Class LoadModule Public Shared Function ViewModule() As Boolean Return True End Function End Class End Namespace ---------------------------------------- Now I am using that dll in my project whenever needed... Dim CAssembly As Assembly = Assembly.LoadFrom(My.Application.Info.DirectoryPath & "\" & "FR6Customise.dll") Dim scriptType As Type = CAssembly.GetType("Fr6Customise. LoadModule") Dim mi As MethodInfo = scriptType.GetMethod("ViewModule") But, when I am using this Code scriptType always return Nothing. There is any error found in this Code. How Can I Solevd It. Pl, Help me.

      Arindam Banerjee Sr. Software Developer Rance Computer Pvt Ltd. Kolkata (India)

      E Offline
      E Offline
      Estys
      wrote on last edited by
      #2

      ...
      Dim scriptType As Type = CAssembly.GetType("Fr6Customise.Fr6Customise.LoadModule")
      ....

      That works for me, it's the fullname of the type

      P 1 Reply Last reply
      0
      • E Estys

        ...
        Dim scriptType As Type = CAssembly.GetType("Fr6Customise.Fr6Customise.LoadModule")
        ....

        That works for me, it's the fullname of the type

        P Offline
        P Offline
        pdnet
        wrote on last edited by
        #3

        No, its Return "Nothing" Can You Just Email me Your Code.My Email ID : webarindam@gmail.com

        Arindam Banerjee Sr. Software Developer Rance Computer Pvt Ltd. Kolkata (India)

        E 1 Reply Last reply
        0
        • P pdnet

          No, its Return "Nothing" Can You Just Email me Your Code.My Email ID : webarindam@gmail.com

          Arindam Banerjee Sr. Software Developer Rance Computer Pvt Ltd. Kolkata (India)

          E Offline
          E Offline
          Estys
          wrote on last edited by
          #4

          Look in your application properties (of Fr6Customize) The value of your "Root namespace" is the root of the fullname of your Type. To see all types add the following line :

          Dim types() as Type = CAssembly.GetTypes()

          Set a breakpoint after this line and add a watch. BTW just nitpicking, your code

          CAssembly.GetType("Fr6Customise. LoadModule")

          has a space in the name. no luck mailing my code : "reason: 552-5.7.0 Our system detected an illegal attachment on your message." :omg:

          modified on Tuesday, January 19, 2010 9:05 AM

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups