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 HELL!

DLL HELL!

Scheduled Pinned Locked Moved C#
visual-studiocsharphelpcsscom
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.
  • J Offline
    J Offline
    James Simpson
    wrote on last edited by
    #1

    Hi All, I have a problem which is driving me barmy. I am writing a VS.NET integration package which refereces a API which contains a data layer and a web control layer. When the package is loaded by the studio and I attempt to invoke a form from UITypeEditor.EditValue on a property in a web control in design mode I can not cast the value parameter (which is a type from the API) from 'object' to its correct type, the layout below might help: 1) Package Directory: API Assembly Package Assembly 2) VS.NET ID Directory API Assembly (needs to be here so the property grid can load it) 3) Web Project Running in design mode with the package loaded has a reference to the API Assembly (from the IDE Folder) In UITypeEditor.EditValue I am doing this: Criteria c1 = (Criteria)value; // Specified Cast is not valid (also if(value is Criteria) fails) Criteria c2 = new Criteria(); In debug, the watch reveals the the 'value' object is infact a Criteria object, however they are loaded from two different assemblys. The versions are identical, but the locations are different: The Location for 'value' comes from a temporary projects assembly folder (more than likely created and managed by visual studio), however 'c2' is coming from the API Assembly in the VS.NET Directory. This is probably because the call is within the context of the vs.net property grid which has loaded its dll from there. Now, I am hoping there is a correct method of getting around this! Regards, James Simpson James Simpson Web Developer imebgo@hotmail.com P S - This is what part of the alphabet would look like if Q and R were eliminated
    Mitch Hedberg

    M 1 Reply Last reply
    0
    • J James Simpson

      Hi All, I have a problem which is driving me barmy. I am writing a VS.NET integration package which refereces a API which contains a data layer and a web control layer. When the package is loaded by the studio and I attempt to invoke a form from UITypeEditor.EditValue on a property in a web control in design mode I can not cast the value parameter (which is a type from the API) from 'object' to its correct type, the layout below might help: 1) Package Directory: API Assembly Package Assembly 2) VS.NET ID Directory API Assembly (needs to be here so the property grid can load it) 3) Web Project Running in design mode with the package loaded has a reference to the API Assembly (from the IDE Folder) In UITypeEditor.EditValue I am doing this: Criteria c1 = (Criteria)value; // Specified Cast is not valid (also if(value is Criteria) fails) Criteria c2 = new Criteria(); In debug, the watch reveals the the 'value' object is infact a Criteria object, however they are loaded from two different assemblys. The versions are identical, but the locations are different: The Location for 'value' comes from a temporary projects assembly folder (more than likely created and managed by visual studio), however 'c2' is coming from the API Assembly in the VS.NET Directory. This is probably because the call is within the context of the vs.net property grid which has loaded its dll from there. Now, I am hoping there is a correct method of getting around this! Regards, James Simpson James Simpson Web Developer imebgo@hotmail.com P S - This is what part of the alphabet would look like if Q and R were eliminated
      Mitch Hedberg

      M Offline
      M Offline
      Marc Clifton
      wrote on last edited by
      #2

      This may lead you in totally the wrong direction, but what if you were to specify your own assembly resolver using AppDomain.CurrentDomain.AssemblyResolve? Does this allow you to specify where to load the assembly when using the designer? As I said, beware of wild goose chases with regards to my suggestion. Marc MyXaml Advanced Unit Testing YAPO

      J 1 Reply Last reply
      0
      • M Marc Clifton

        This may lead you in totally the wrong direction, but what if you were to specify your own assembly resolver using AppDomain.CurrentDomain.AssemblyResolve? Does this allow you to specify where to load the assembly when using the designer? As I said, beware of wild goose chases with regards to my suggestion. Marc MyXaml Advanced Unit Testing YAPO

        J Offline
        J Offline
        James Simpson
        wrote on last edited by
        #3

        Thank You Marc, That was successful. I removed the DLL's from the IDE directory and handled the AssemblyResolve function in the package, returned the correct assembly and the value casts as it should. Cheers! James James Simpson Web Developer imebgo@hotmail.com P S - This is what part of the alphabet would look like if Q and R were eliminated
        Mitch Hedberg

        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