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. C#
  4. Loading an assembly

Loading an assembly

Scheduled Pinned Locked Moved C#
question
2 Posts 1 Posters 1 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.
  • L Offline
    L Offline
    lustuyck
    wrote on last edited by
    #1

    I have a windows application called X, I build it, and evidently I can run the executable X.exe. But now, I build this application to a X.dll; and I want to load that X.dll from another application YYY.EXE, and start the X-application. I tried in Y: Assembly assemblyX = Assembly.Load("X"); // works Type typeX = assemblyX.GetType("namespace + classname"); // works MethodInfo methodinfoCOnstructor = typePlannet.GetMethod("?"); // ? How can I start application X? Thanks!

    L 1 Reply Last reply
    0
    • L lustuyck

      I have a windows application called X, I build it, and evidently I can run the executable X.exe. But now, I build this application to a X.dll; and I want to load that X.dll from another application YYY.EXE, and start the X-application. I tried in Y: Assembly assemblyX = Assembly.Load("X"); // works Type typeX = assemblyX.GetType("namespace + classname"); // works MethodInfo methodinfoCOnstructor = typePlannet.GetMethod("?"); // ? How can I start application X? Thanks!

      L Offline
      L Offline
      lustuyck
      wrote on last edited by
      #2

      I just found it myself: Assembly assPlannet = Assembly.Load("Plannet"); Type typePlannet = assPlannet.GetType("Conseur.Plannet.PlannetClient"); MethodInfo methodinfoMain = typePlannet.GetMethod("Main"); Object obj = Activator.CreateInstance(typePlannet); Object[] args = new Object[1]; methodinfoMain.Invoke(obj, null);

      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