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 dinamically assemblies from COM+ .NET components

Loading dinamically assemblies from COM+ .NET components

Scheduled Pinned Locked Moved .NET (Core and Framework)
questioncsharpdotnetcomhelp
4 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.
  • F Offline
    F Offline
    fennnan
    wrote on last edited by
    #1

    Hi all, Does anybody know if there are problems loading and assembly using the static 'Assembly.Load' or similar from a .NET COM+ component? I have found that doing it my component wait as if it was in an infinite loop. I read only a line in the help about using the dinamic 'AppDomain.Load' inside these components. I did it and it works fine. A second question would be now if it is possible load from the GAC using AppDomain.Load, providing an assembly partial name. TIA Fennnan

    S 1 Reply Last reply
    0
    • F fennnan

      Hi all, Does anybody know if there are problems loading and assembly using the static 'Assembly.Load' or similar from a .NET COM+ component? I have found that doing it my component wait as if it was in an infinite loop. I read only a line in the help about using the dinamic 'AppDomain.Load' inside these components. I did it and it works fine. A second question would be now if it is possible load from the GAC using AppDomain.Load, providing an assembly partial name. TIA Fennnan

      S Offline
      S Offline
      Simon Gregory
      wrote on last edited by
      #2

      Here's waht I use - it also late binds to a Enterpise Serviced component in COM+ - and calls the VersionProperty on the class represented by the Prog ID... // Create a Crypto Manager - Create the Type locally Type tEngine = Type.GetTypeFromProgID("Collaborator50.EQOSCollaborator", vstrAppServer, true); // Create an Instance of Type objEngine = Activator.CreateInstance(tEngine); // Make the call object objVersion = tEngine.InvokeMember( "Version", BindingFlags.Public | BindingFlags.GetProperty, null, objEngine, null);

      F 1 Reply Last reply
      0
      • S Simon Gregory

        Here's waht I use - it also late binds to a Enterpise Serviced component in COM+ - and calls the VersionProperty on the class represented by the Prog ID... // Create a Crypto Manager - Create the Type locally Type tEngine = Type.GetTypeFromProgID("Collaborator50.EQOSCollaborator", vstrAppServer, true); // Create an Instance of Type objEngine = Activator.CreateInstance(tEngine); // Make the call object objVersion = tEngine.InvokeMember( "Version", BindingFlags.Public | BindingFlags.GetProperty, null, objEngine, null);

        F Offline
        F Offline
        fennnan
        wrote on last edited by
        #3

        It's possible I didn't explain myself well: Inside an Enterprise Services component I need to invoke, using reflection, a .NET class. The class I'm instanciating has not a COM Wrapper so has not a ProgId, so I can't load it using GetTypeFromProgID. Using the static method Assembly.LoadWithPartialName, I don't need to care about version, culture, etc. The problem is it stops my COM+ component (an Enterprise Service class), as if it was in an infinite loop. Then I found AppDomain.Load. This method is not static, so I use AppDomain.CurrentDomain in order to call the method. And it works!:omg:. From Microsoft documentation about this method it says: "This method is defined for interoperability callers who cannot call the static Load method." However, is the only reference I've found all around about this topic. If it works, why am I asking for? :confused: Cause I can't load assemblies with partial name using this method :(( I hope you're not being bored with my explanation! :cool: Cheers

        S 1 Reply Last reply
        0
        • F fennnan

          It's possible I didn't explain myself well: Inside an Enterprise Services component I need to invoke, using reflection, a .NET class. The class I'm instanciating has not a COM Wrapper so has not a ProgId, so I can't load it using GetTypeFromProgID. Using the static method Assembly.LoadWithPartialName, I don't need to care about version, culture, etc. The problem is it stops my COM+ component (an Enterprise Service class), as if it was in an infinite loop. Then I found AppDomain.Load. This method is not static, so I use AppDomain.CurrentDomain in order to call the method. And it works!:omg:. From Microsoft documentation about this method it says: "This method is defined for interoperability callers who cannot call the static Load method." However, is the only reference I've found all around about this topic. If it works, why am I asking for? :confused: Cause I can't load assemblies with partial name using this method :(( I hope you're not being bored with my explanation! :cool: Cheers

          S Offline
          S Offline
          Simon Gregory
          wrote on last edited by
          #4

          Not bored - just nonplussed. We do this the 1st way you talekd about a lot from Serviced components and it works fine.

          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