473,549 Members | 2,723 Online
Bytes | Software Development & Data Engineering Community
+ 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=VBScri pt %>
<% Option Explicit %>
<%
Dim WebFarmSession: WebFarmSession = CreateObject("C omTest.WebFarmS ession")
%>
Jul 21 '05 #1
4 12946
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**********@d iscussions.micr osoft.com> wrote in message
news:01******** *************** ***********@mic rosoft.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=VBScri pt %>
<% Option Explicit %>
<%
Dim WebFarmSession: WebFarmSession = CreateObject("C omTest.WebFarmS ession") %>

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**********@d iscussions.micr osoft.com> wrote in message
news:01******** *************** ***********@mic rosoft.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=VBScri pt %>
<% Option Explicit %>
<%
Dim WebFarmSession: WebFarmSession = CreateObject("C omTest.WebFarmS ession") %>

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("C omTest.WebFarmS ession")
myobj.testmetho d()

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.CreateOb ject("ComTest.W ebFarmSession")

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**********@d iscussions.micr osoft.com> wrote in message
news:01******** *************** ***********@mic rosoft.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=VBScri pt %>
<% Option Explicit %>
<%
Dim WebFarmSession: WebFarmSession =

CreateObject("C omTest.WebFarmS ession")
%>


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(fals e)]. 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
4363
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 files containing some templates: adjacency_list.hpp and mem_fn.hpp can not compile. Does anyone have any solutions?
5
16227
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 Server might not be running or the path exists and is redirected to another machine. Please check the status of this virtual directory in the Internet...
13
6580
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
4985
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. I created the websetup and built the MSI, have the bundled version. Copied to webserver and ran Websetup.msi. Said I had to remove old version,...
2
5302
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: 1>make_buildinfo.obj : error LNK2019: unresolved external symbol __imp__RegQueryValueExA@24 referenced in function _make_buildinfo2 Ask on...
2
19418
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 will be writing this article intended for those who are in the same level, or maybe lower, of my technical knowledge. I would be using layman's...
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 will be writing this article intended for those who are in the same level, or maybe lower, of my technical knowledge. I would be using layman's...
5
4158
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' : is not a class or namespace name D:\Program Files\visual studio 6.0\MSDev98\MyProjects\GLEnabledView\GLNew.cpp(164) : error C2061: syntax error :...
2
3232
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... 1>tdrawAa.obj : error LNK2005: _main already defined in tclose.obj
0
7720
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7957
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7470
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7809
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5368
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5088
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3500
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1059
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
763
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.