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 Dlls programatically in C#

Loading Dlls programatically in C#

Scheduled Pinned Locked Moved C#
csharpdesignbeta-testinghelpquestion
3 Posts 3 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.
  • T Offline
    T Offline
    Tina P
    wrote on last edited by
    #1

    Hey guys, I need to be able to figure out (based on users selection from the UI) which class library project to use. In other words, there is a mthod lets say initialize or something that would be receiving some parameters from the User (such as the name of the class library project and it's type, however the name is enough to have some sort of a if else block and load the right project. Well actually I wanna be careful here, it's not really loading the class library project from here, it's more like using the correct project for all the subsequent method calls from this project (as the class library projects may or maynot be different from each other in terms of the methods they define. So I need to be able to point this project, which also happens to be a Class library project to the correct version of the subsequent project based on the name of the project that is provided by the user from the UI text box. I'm sure whats the ideal solution here, I think I should just add a reference dynamically based on the project name coming in....in other words do some sort of string comparison adn based on that add a reference to the right Class library project adn then it will point to it. can someone please help me with this, if you think this isn't what needs to happen, or if it is the right approach, any feedback would be highly appreciated? Thanks Tina

    H S 2 Replies Last reply
    0
    • T Tina P

      Hey guys, I need to be able to figure out (based on users selection from the UI) which class library project to use. In other words, there is a mthod lets say initialize or something that would be receiving some parameters from the User (such as the name of the class library project and it's type, however the name is enough to have some sort of a if else block and load the right project. Well actually I wanna be careful here, it's not really loading the class library project from here, it's more like using the correct project for all the subsequent method calls from this project (as the class library projects may or maynot be different from each other in terms of the methods they define. So I need to be able to point this project, which also happens to be a Class library project to the correct version of the subsequent project based on the name of the project that is provided by the user from the UI text box. I'm sure whats the ideal solution here, I think I should just add a reference dynamically based on the project name coming in....in other words do some sort of string comparison adn based on that add a reference to the right Class library project adn then it will point to it. can someone please help me with this, if you think this isn't what needs to happen, or if it is the right approach, any feedback would be highly appreciated? Thanks Tina

      H Offline
      H Offline
      himanshu2561
      wrote on last edited by
      #2

      Hi, I think you might need to look for Reflection to achieve this.

      himanshu

      1 Reply Last reply
      0
      • T Tina P

        Hey guys, I need to be able to figure out (based on users selection from the UI) which class library project to use. In other words, there is a mthod lets say initialize or something that would be receiving some parameters from the User (such as the name of the class library project and it's type, however the name is enough to have some sort of a if else block and load the right project. Well actually I wanna be careful here, it's not really loading the class library project from here, it's more like using the correct project for all the subsequent method calls from this project (as the class library projects may or maynot be different from each other in terms of the methods they define. So I need to be able to point this project, which also happens to be a Class library project to the correct version of the subsequent project based on the name of the project that is provided by the user from the UI text box. I'm sure whats the ideal solution here, I think I should just add a reference dynamically based on the project name coming in....in other words do some sort of string comparison adn based on that add a reference to the right Class library project adn then it will point to it. can someone please help me with this, if you think this isn't what needs to happen, or if it is the right approach, any feedback would be highly appreciated? Thanks Tina

        S Offline
        S Offline
        Shukla Rahul
        wrote on last edited by
        #3

        Hi Tina, I would suggest you to go with a event subscription based model to achieve this. Please see Observer Pattern for details. Make one project for Subject & Define all the other dll projects as observers. Let me know if you want to see a working code of it. Regards, Rahul Shukla

        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