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. Dll problem

Dll problem

Scheduled Pinned Locked Moved C#
questioncsharphardwarehelp
4 Posts 4 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.
  • M Offline
    M Offline
    marca292
    wrote on last edited by
    #1

    I have a C# application that tests a product my company developes. At the moment this application can be run on a ordinary laptop. I have now started to develope new tests that requires specific hardware and dll:s. These new tests can only be run on a computer that has this hardware installed. What is the best solution if I still want to be able to use the same application on an ordinary laptop to run the other tests that don't requires the new hardware? The "ordinary laptop" is missing the dll:s that my application is using to communicatio with the hardware.

    D I 2 Replies Last reply
    0
    • M marca292

      I have a C# application that tests a product my company developes. At the moment this application can be run on a ordinary laptop. I have now started to develope new tests that requires specific hardware and dll:s. These new tests can only be run on a computer that has this hardware installed. What is the best solution if I still want to be able to use the same application on an ordinary laptop to run the other tests that don't requires the new hardware? The "ordinary laptop" is missing the dll:s that my application is using to communicatio with the hardware.

      D Offline
      D Offline
      David Knechtges
      wrote on last edited by
      #2

      I can think of 3 ways you could do this: 1) Enable remote debugging in Visual Studio and run all the tests on a computer with the hardware installed. So your laptop can run the tests and the hardware also. 2) Add a few conditional compile options around the calls you have into the hardware specific DLLs - this makes them not execute at all. 3) Stub out the hardware DLLs on your dev laptop by creating special versions of them that run without the hardware attached. So basically, they can return to you known data when called, and do nothing when no return data is required.

      G 1 Reply Last reply
      0
      • M marca292

        I have a C# application that tests a product my company developes. At the moment this application can be run on a ordinary laptop. I have now started to develope new tests that requires specific hardware and dll:s. These new tests can only be run on a computer that has this hardware installed. What is the best solution if I still want to be able to use the same application on an ordinary laptop to run the other tests that don't requires the new hardware? The "ordinary laptop" is missing the dll:s that my application is using to communicatio with the hardware.

        I Offline
        I Offline
        Ingo
        wrote on last edited by
        #3

        Load the DLL dynamically depending on the Hardware (take a look at Assembly.LoadFrom).

        ------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.

        1 Reply Last reply
        0
        • D David Knechtges

          I can think of 3 ways you could do this: 1) Enable remote debugging in Visual Studio and run all the tests on a computer with the hardware installed. So your laptop can run the tests and the hardware also. 2) Add a few conditional compile options around the calls you have into the hardware specific DLLs - this makes them not execute at all. 3) Stub out the hardware DLLs on your dev laptop by creating special versions of them that run without the hardware attached. So basically, they can return to you known data when called, and do nothing when no return data is required.

          G Offline
          G Offline
          Gergo Bogdan
          wrote on last edited by
          #4

          I think the most widely used point for these situation is what you have proposed as 3rd option. Simply Mock your hardware specific assemblies (I don't know how hard that is), this way on a laptop you can test only your code and in the mocks implement whatever functionality you need assuming that "the hardware" works ok. When running the tests on the actual device you can simply remove the mock assemblies and you can also run your tests.

          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