473,387 Members | 1,899 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

COM objects in asp.net session

Jim
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.
Nov 17 '05 #1
2 1762
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" <jp*****@profile-systems.com> wrote in message
news:0a****************************@phx.gbl...
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.

Nov 17 '05 #2
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" <jp*****@profile-systems.com> wrote in message
news:0a****************************@phx.gbl...
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.

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Dave Wurtz | last post by:
All, I'm new to ASP development and I have a basic design question: Is it ok to store business objects to session variables or is there a better way to keep object information? For example,...
8
by: Keith-Earl | last post by:
Okay, looking for a Best Practice. We are building a classic three tier app in VB.NET. When we load up a WebForm we have access to very useful objects such as the Session object. We frequently...
2
by: Chris | last post by:
Hi, I am building a single webform/webpage asp.net application using VB.NET. I have created lots of classes for this web application. On page load I use a facade controller pattern class to...
10
by: Mark Rae | last post by:
Hi, This relates to the previous thread "Disappearing Sessions", but is a bit more generic so I thought I'd start a new thread. This one relates to the storing of objects in Session once only to...
47
by: Max | last post by:
Due to the behaviour of a particular COM object, I need to ensure that a request for a particular ASP page is finalized before another request for the page is processed. Does IIS have a way to...
2
by: HankD | last post by:
Hi, I am having a problem with instantiating two custom objects so they DO NOT point to the same memory location. What is happening is that changes I am making to my object1 are changing object2. I...
4
by: mark_drewersback | last post by:
I've been developing in .net for approx 6 months now and would like an opinion on whether it is ok to use session to store objects? I normally create a property such as below in code behind on...
3
by: Maximiliano | last post by:
Hello, I have an asp.net project that calculates a general tax. Ok, this tax is a big object formed with another child objects (as a mather of fact 15 another child object within it), like Ship,...
13
by: DigitalDave | last post by:
A project I did awhile back stored php5 objects in elements of the $_SESSION array between pages that were navigated on the site. There were object classes representing teachers, and object classes...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.