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. Loading an assembly at runtime

Loading an assembly at runtime

Scheduled Pinned Locked Moved .NET (Core and Framework)
helpdatabasexmlquestion
3 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.
  • K Offline
    K Offline
    kristmun
    wrote on last edited by
    #1

    Hi, I´m trying to load an assembly at runtime with: ObjectHandle plugin = System.Activator.CreateInstanceFrom(@"C:\PathToDll\MyDll.dll", "PluginClass"); But this returns a strange error: Exception has been thrown by the target of an invocation. "The targetNamespace parameter 'MyDll' should be the same value as the targetNamespace 'urn:MyDll' of the schema." ok, where does a schema come into the picture? All help would be appreciated.

    _ 1 Reply Last reply
    0
    • K kristmun

      Hi, I´m trying to load an assembly at runtime with: ObjectHandle plugin = System.Activator.CreateInstanceFrom(@"C:\PathToDll\MyDll.dll", "PluginClass"); But this returns a strange error: Exception has been thrown by the target of an invocation. "The targetNamespace parameter 'MyDll' should be the same value as the targetNamespace 'urn:MyDll' of the schema." ok, where does a schema come into the picture? All help would be appreciated.

      _ Offline
      _ Offline
      __DanC__
      wrote on last edited by
      #2

      I think that would imply that you need to specify the namespace in the class type field and it should match the DLL name, so try: ObjectHandle plugin = System.Activator.CreateInstanceFrom(@"C:\PathToDll\MyDll.dll", "MyDll.PluginClass"); Hope that helps!

      K 1 Reply Last reply
      0
      • _ __DanC__

        I think that would imply that you need to specify the namespace in the class type field and it should match the DLL name, so try: ObjectHandle plugin = System.Activator.CreateInstanceFrom(@"C:\PathToDll\MyDll.dll", "MyDll.PluginClass"); Hope that helps!

        K Offline
        K Offline
        kristmun
        wrote on last edited by
        #3

        Worked, thanks!

        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