By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,571 Members | 1,659 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,571 IT Pros & Developers. It's quick & easy.

VB.NET Threading for COM Interop in ASP

P: n/a
I was wondering if anybody has run into anything like this before and if
there is a solution. What I am trying to do is create a Class Library in
VB.NET which, when compiled, is registered for COM Interop. This .NET/COM
component is to be used within an ASP page. It instantiates correctly, but
when trying to add it to an Application variable, I get the following error
message:

<font face="Arial" size=2>
<p>Application object</font> <font face="Arial" size=2>error 'ASP 0197 :
80004005'</font>
<p>
<font face="Arial" size=2>Disallowed object use</font>
<p>
<font face="Arial" size=2>//global.asa</font><font face="Arial" size=2>,
line 112</font>
<p>
<font face="Arial" size=2>Cannot add object with apartment model behavior to
the application intrinsic object.
</font>
Upon doing some research, I found something which mentioned to place the
<MTAThread> attribute before the entry-point (Public Shared Sub Main) of the
class. The class that I am using does not have an entry point aside from
Sub New which <MTAThread> cannot attach itself to. It is essentially a data
class which uses ADO.NET to read/write information with a SQL Server
database. I also tried attaching the <MTAThread> attribute to each Public
method defined within the class which did not work.

Thanks,
Jody
Nov 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.