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. Problems calling a COM+ component

Problems calling a COM+ component

Scheduled Pinned Locked Moved C#
asp-netcomhelpworkspace
4 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.
  • I Offline
    I Offline
    Ivan Fernandez
    wrote on last edited by
    #1

    Hi, I've got a problem, calling via remoting, a COM+ which activation is type library. I configure the client application and the web.config file, then I make the call, and that's ok. The problem appears because my COM+ application has to read information from a configuration file. My first attempt to solve this, was to introduce this information in the web.config file, but it doesn't work. The fact is that the configuration file which it's been read is aspnet_wp.exe.config, instead web.config. I am creating the COM+ through a wrapper. When I call the wrapper, it is executed in one AppDomain, but when the wrapper creates the instance of the component, the AppDomain is changed to the Default AppDomain, changing also the configuration file used. I hope to give enough information (and understable!!!;P) If you need further information, please, don't hesitate asking me. Thanks, Ivan. Iván Fernández

    B H 2 Replies Last reply
    0
    • I Ivan Fernandez

      Hi, I've got a problem, calling via remoting, a COM+ which activation is type library. I configure the client application and the web.config file, then I make the call, and that's ok. The problem appears because my COM+ application has to read information from a configuration file. My first attempt to solve this, was to introduce this information in the web.config file, but it doesn't work. The fact is that the configuration file which it's been read is aspnet_wp.exe.config, instead web.config. I am creating the COM+ through a wrapper. When I call the wrapper, it is executed in one AppDomain, but when the wrapper creates the instance of the component, the AppDomain is changed to the Default AppDomain, changing also the configuration file used. I hope to give enough information (and understable!!!;P) If you need further information, please, don't hesitate asking me. Thanks, Ivan. Iván Fernández

      B Offline
      B Offline
      Bruce Duncan
      wrote on last edited by
      #2

      I don't think what you are trying to do is possible. As far as I know, .config files can only be used with applications (theapp.exe.config) or ASP.NET (web.config). You would find that if your COM+ application used Server (as opposed to Library) Activation, to config file that the .NET framework would try to load would be dllhost.exe.config. I assume one could try to force the .NET classes used to read the configuration to load the info from a specific file, but I've never used them myself (I don't even know which are used :-O ) If anyone knows any better, or if I am talking rubbish, please correct me. :)

      Searching the web without Google is like straining sewage with your teeth.
      Userfriendly, 2003/06/07

      I 1 Reply Last reply
      0
      • B Bruce Duncan

        I don't think what you are trying to do is possible. As far as I know, .config files can only be used with applications (theapp.exe.config) or ASP.NET (web.config). You would find that if your COM+ application used Server (as opposed to Library) Activation, to config file that the .NET framework would try to load would be dllhost.exe.config. I assume one could try to force the .NET classes used to read the configuration to load the info from a specific file, but I've never used them myself (I don't even know which are used :-O ) If anyone knows any better, or if I am talking rubbish, please correct me. :)

        Searching the web without Google is like straining sewage with your teeth.
        Userfriendly, 2003/06/07

        I Offline
        I Offline
        Ivan Fernandez
        wrote on last edited by
        #3

        I can't use the COM+ application like Server because I don't want to have any dll in the GAC. I want to use probing to indicate where my application has to search for the asssemblies. I could use another file to read the configuration information, like you said, but the probing information, as far as I know, has to be in the application config file. Any other suggestion?? Thanks!! Iván Fernández

        1 Reply Last reply
        0
        • I Ivan Fernandez

          Hi, I've got a problem, calling via remoting, a COM+ which activation is type library. I configure the client application and the web.config file, then I make the call, and that's ok. The problem appears because my COM+ application has to read information from a configuration file. My first attempt to solve this, was to introduce this information in the web.config file, but it doesn't work. The fact is that the configuration file which it's been read is aspnet_wp.exe.config, instead web.config. I am creating the COM+ through a wrapper. When I call the wrapper, it is executed in one AppDomain, but when the wrapper creates the instance of the component, the AppDomain is changed to the Default AppDomain, changing also the configuration file used. I hope to give enough information (and understable!!!;P) If you need further information, please, don't hesitate asking me. Thanks, Ivan. Iván Fernández

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #4

          What it comes down to is the CLR host. The ASP.NET host is hardcoded to use the Web.config file as its configuration file. The executable loader by default uses yourapp.exe.config. In your case, it's odd that aspnet_wp.exe.config is being used. In any case, if you are using a wrapper, perhaps your wrapper has a chance to create the AppDomain that hosts the COM+ service itself? If so, when you are configuring the AppDomain, you can specify any .config file you want so long as the CLR can resolve the location. See AppDomain.SetupInformation for more details.

          -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

          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