error '80131509'
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > IIS server support > IIS ASP > error '80131509'




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    error '80131509'  
Jason Rowland


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-19-04 07:48 AM

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")
%>





[ Post a follow-up to this message ]



    Re: error '80131509'  
Aaron [SQL Server MVP]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-19-04 12:50 PM

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" <JasonRowland@discussions.microsoft.com> wrote in message
news:0190289D-F0E5-4F46-810D-660B538889B1@microsoft.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")
> %>







[ Post a follow-up to this message ]



    Re: error '80131509'  
Aaron [SQL Server MVP]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-19-04 12:50 PM

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" <JasonRowland@discussions.microsoft.com> wrote in message
news:0190289D-F0E5-4F46-810D-660B538889B1@microsoft.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")
> %>







[ Post a follow-up to this message ]



    Re: error '80131509'  
Jason Rowland


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-19-04 10:51 PM

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 experienc
e
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" <JasonRowland@discussions.microsoft.com> wrote in message
> news:0190289D-F0E5-4F46-810D-660B538889B1@microsoft.com... 
> create 
> CreateObject("ComTest.WebFarmSession") 
>
>
>





[ Post a follow-up to this message ]



    Re: error '80131509'  
bseddon


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-17-06 06:28 PM


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
------------------------------------------------------------------------






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:47 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register