473,484 Members | 1,771 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

error '80131509'

I created a .NET assembly and made it accessable as a COM object. When I
tried to instantiate it in an ASP page, I got error '80131509'. If I create
the COM object in a simple HTML page it works fine. I am using ASP, not
ASP.NET. Searching for the number on google gives no help whatsoever.

This is the ASP that I am using:
<%@ Language=VBScript %>
<% Option Explicit %>
<%
Dim WebFarmSession: WebFarmSession = CreateObject("ComTest.WebFarmSession")
%>
Jul 21 '05 #1
4 12935
How are you "creating the COM object in a simple HTML page"? Is it a
control that the user will see? Otherwise, what purpose could it serve in
HTML?

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Jason Rowland" <Ja**********@discussions.microsoft.com> wrote in message
news:01**********************************@microsof t.com...
I created a .NET assembly and made it accessable as a COM object. When I
tried to instantiate it in an ASP page, I got error '80131509'. If I create the COM object in a simple HTML page it works fine. I am using ASP, not
ASP.NET. Searching for the number on google gives no help whatsoever.

This is the ASP that I am using:
<%@ Language=VBScript %>
<% Option Explicit %>
<%
Dim WebFarmSession: WebFarmSession = CreateObject("ComTest.WebFarmSession") %>

Jul 21 '05 #2
How are you "creating the COM object in a simple HTML page"? Is it a
control that the user will see? Otherwise, what purpose could it serve in
HTML?

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Jason Rowland" <Ja**********@discussions.microsoft.com> wrote in message
news:01**********************************@microsof t.com...
I created a .NET assembly and made it accessable as a COM object. When I
tried to instantiate it in an ASP page, I got error '80131509'. If I create the COM object in a simple HTML page it works fine. I am using ASP, not
ASP.NET. Searching for the number on google gives no help whatsoever.

This is the ASP that I am using:
<%@ Language=VBScript %>
<% Option Explicit %>
<%
Dim WebFarmSession: WebFarmSession = CreateObject("ComTest.WebFarmSession") %>

Jul 21 '05 #3
I am creating it on the HTML page just to test that my .NET COM object was
working properly (it was).
dim myobj
set myobj = CreateObject("ComTest.WebFarmSession")
myobj.testmethod()

When I moved the code to an ASP page to use it server side where it will be
used, I got the error. The error message "error 80131509" that is returned
is extremely unhelpful. The problem is I don't know ASP as all my experience
is .NET, java. Instead of the code that worked for me in the html file, I
needed to use:

set WebFarmSession = Server.CreateObject("ComTest.WebFarmSession")

If you omit the "Server." prefix, you get that error.

"Aaron [SQL Server MVP]" wrote:
How are you "creating the COM object in a simple HTML page"? Is it a
control that the user will see? Otherwise, what purpose could it serve in
HTML?

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Jason Rowland" <Ja**********@discussions.microsoft.com> wrote in message
news:01**********************************@microsof t.com...
I created a .NET assembly and made it accessable as a COM object. When I
tried to instantiate it in an ASP page, I got error '80131509'. If I

create
the COM object in a simple HTML page it works fine. I am using ASP, not
ASP.NET. Searching for the number on google gives no help whatsoever.

This is the ASP that I am using:
<%@ Language=VBScript %>
<% Option Explicit %>
<%
Dim WebFarmSession: WebFarmSession =

CreateObject("ComTest.WebFarmSession")
%>


Jul 21 '05 #4

Jason Rowland wrote:
[b]I created a .NET assembly and made it accessable as a COM object.
When I
tried to instantiate it in an ASP page, I got error '80131509'.


This reply is being posted (two years too late) because I ran into the
80131509 problem and this post is the most frequently presented by
Google in response to this error number. However the thread doesn't
(didn't) contain an answer. Having spent two hours cracking the
problems, others might save a bit of time knowing an answer.

Like Jason I have a .NET (C# as it turns out) assembly that exposes a
class as a COM object. When used from an Excel add-in (written in VB)
the class works. But if the COM class exposed by the assembly is
instantiated from a .vbs script or even a VB program an 80131509 error
is raised. When I put message boxes in the class constructor I could
see that the constructor runs successfully but that the error is raised
after - so reason suggests that it was not a code problem.

After stripping out ALL the code, the only slightly unusual thing left
was that the exposed class inherits from a base class. Because I don't
want the base class exposed to COM it was decorated with
[ComVisible(false)]. When I finally removed this decoration from the
base class the COM class worked in VB and in scripts.

So it seems mscorlib does not want to expose a .NET class to COM if
it's base class is not visible. My lesson is that classes which are to
be exposed should not inherit. They should single classes that delegate
to a contained instance of the class that really does the work.

--
bseddon
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Jun 17 '06 #5

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

Similar topics

2
4357
by: AIM | last post by:
Error in msvc in building inheritance.obj to build hello.pyd Hello, I am trying to build the boost 1.31.0 sample extension hello.cpp. I can not compile the file inheritance.cpp because the two...
5
16209
by: Tony Wright | last post by:
Hi, I am having a problem installing an msi for a web site. The error message I am getting is: "The specified path 'http://mipdev05/features/Fas2' is unavailable. The Internet Information...
13
6569
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
7
4976
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
2
5298
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: ...
2
19390
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
2897
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
5
4154
by: yashu0209 | last post by:
I have an error occurring when i try to compile the program and the error is: D:\Program Files\visual studio 6.0\MSDev98\MyProjects\GLEnabledView\GLNew.cpp(164) : error C2653: 'CGLEnabledView' :...
2
3229
by: randa zaghdan | last post by:
Hi I have a problem with my program in vc 2008 When I compile it, the following errors are listed. I try to resolve it but no hope Does any one can help me ? thanks . Linking......
0
7080
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
7140
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...
0
7209
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4841
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4527
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3038
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1355
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
588
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
234
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.