COM objects in asp.net session

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jim

    #1

    COM objects in asp.net session

    I have been tasked with migrating a legacy asp website
    into asp.net. The website uses COM objects in session all
    over the place (which is terrible but because the code is
    going to be eventually phased out so its something that
    we want to try to live with a bit longer).

    The problem I am having is that these COM objects
    (written in VB 6) don't survive from 1 page to the next.
    It looks like the wrapper is stored in session but not
    the object itself. When the page goes out of scope it
    looks as if the object is destroyed. This is the error
    message I am getting:

    COM object that has been separated from its underlying
    RCW can not be used.

    Has anybody else experienced this problem? Is it not
    possible to store these COM objects in session? I have
    set aspcompat=true. It appears that storing an ADO
    connection object in session works fine but these VB
    created objects do not.
  • bruce barker

    #2
    Re: COM objects in asp.net session

    the error message means you are calling the com object on a different thread
    than it was created in. asp had lots of code to handle sta objects, asp.net
    does not. the best thing you can do with asp.net is host them in com+
    instead of session, then port them as quick as possible.

    -- bruce (sqlwork.com)


    "Jim" <jpetkus@profil e-systems.com> wrote in message
    news:0a4701c34a 4c$9ecb4f40$a00 1280a@phx.gbl.. .[color=blue]
    > I have been tasked with migrating a legacy asp website
    > into asp.net. The website uses COM objects in session all
    > over the place (which is terrible but because the code is
    > going to be eventually phased out so its something that
    > we want to try to live with a bit longer).
    >
    > The problem I am having is that these COM objects
    > (written in VB 6) don't survive from 1 page to the next.
    > It looks like the wrapper is stored in session but not
    > the object itself. When the page goes out of scope it
    > looks as if the object is destroyed. This is the error
    > message I am getting:
    >
    > COM object that has been separated from its underlying
    > RCW can not be used.
    >
    > Has anybody else experienced this problem? Is it not
    > possible to store these COM objects in session? I have
    > set aspcompat=true. It appears that storing an ADO
    > connection object in session works fine but these VB
    > created objects do not.[/color]


    Comment

    • bruce barker

      #3
      Re: COM objects in asp.net session

      the error message means you are calling the com object on a different thread
      than it was created in. asp had lots of code to handle sta objects, asp.net
      does not. the best thing you can do with asp.net is host them in com+
      instead of session, then port them as quick as possible.

      -- bruce (sqlwork.com)


      "Jim" <jpetkus@profil e-systems.com> wrote in message
      news:0a4701c34a 4c$9ecb4f40$a00 1280a@phx.gbl.. .[color=blue]
      > I have been tasked with migrating a legacy asp website
      > into asp.net. The website uses COM objects in session all
      > over the place (which is terrible but because the code is
      > going to be eventually phased out so its something that
      > we want to try to live with a bit longer).
      >
      > The problem I am having is that these COM objects
      > (written in VB 6) don't survive from 1 page to the next.
      > It looks like the wrapper is stored in session but not
      > the object itself. When the page goes out of scope it
      > looks as if the object is destroyed. This is the error
      > message I am getting:
      >
      > COM object that has been separated from its underlying
      > RCW can not be used.
      >
      > Has anybody else experienced this problem? Is it not
      > possible to store these COM objects in session? I have
      > set aspcompat=true. It appears that storing an ADO
      > connection object in session works fine but these VB
      > created objects do not.[/color]


      Comment

      Working...