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. Web Development
  3. Error using COM+ app with ASP.Net

Error using COM+ app with ASP.Net

Scheduled Pinned Locked Moved Web Development
csharpcomhelpasp-netdatabase
2 Posts 1 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
    Marshall
    wrote on last edited by
    #1

    I have a COM+ application that I can successfully use from a C# Windows Forms application. I am able to access the COM+ components via both early and late binding. No problem. However, when I try to use the same COM+ app from an ASP.Net (C# code behind) application, I get a run-time error. If I use early binding I get an InvalidCastException for QueryInterface indicating the interface query failed. If I use late binding I get a TargetInvocationException indicating the target does not implement IDispatch. In the case of the early binding test, I've created an interop assembly via VS.Net, set a reference to it, etc. just as in the Windows Forms application. In both cases, I've set aspcompat=true in the aspx page. I've read the (very good) CP article on COM Interop by Aravind Corera as well as Tom Archer's C# (2ndEd) book, Adam Nathan's book on interop and others but I'm clearly missing something here. What am I missing? :confused:

    M 1 Reply Last reply
    0
    • M Marshall

      I have a COM+ application that I can successfully use from a C# Windows Forms application. I am able to access the COM+ components via both early and late binding. No problem. However, when I try to use the same COM+ app from an ASP.Net (C# code behind) application, I get a run-time error. If I use early binding I get an InvalidCastException for QueryInterface indicating the interface query failed. If I use late binding I get a TargetInvocationException indicating the target does not implement IDispatch. In the case of the early binding test, I've created an interop assembly via VS.Net, set a reference to it, etc. just as in the Windows Forms application. In both cases, I've set aspcompat=true in the aspx page. I've read the (very good) CP article on COM Interop by Aravind Corera as well as Tom Archer's C# (2ndEd) book, Adam Nathan's book on interop and others but I'm clearly missing something here. What am I missing? :confused:

      M Offline
      M Offline
      Marshall
      wrote on last edited by
      #2

      Just after posting, I discovered the problem. :-O I'm posting the solution here in hopes it will help someone else in the future. It turned out to be an authentication issue. Adding the following line to the Web.config file took care of it. (So far...) < identity impersonate="true" /> :) :) :)

      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