473,395 Members | 1,978 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,395 software developers and data experts.

2.0- VB.NET Interop Issue

Long story longer, I'm tearing my hair out trying to get some of my
assemblies to work in ASP/COM. I have 4 classes/assemblies:

#1. CustomerMembershipProvider (Inherits MembershipProvider)
#2. CustomTcpClient (Inherits TcpClient)
#3. ASPFormsAuthentication (does magic to read/write
FormsAuthenticationTickets in ASP 3.0)
#4. ASPMembership (does magic to use Membership API within ASP 3.0)

Now, all of these assemblies are set to "Make assembly COM-Visable" and
"Register for COM Interop". Everything build and registers just fine.
Now, from with ASP, I can Server.CreateObject #3 and #4.
Server.CreateObject for #1 and #2 simply yield me:
Server object error 'ASP 0177 : 80131509'
Server.CreateObject Failed
/Default.asp, line 35
80131509


While the ASPMembership class can be created under COM, the minute it
trys to return a CustomMembershipProvider from itself, the page also
bails with the same error above.

Now, after some tinkering, I noticed the common ground here is that #1
and #2 Inherit something else while #3 and #4 don't.

Clearly there is some COM Interop/InteropServices/Inferace magic I'm
missing. What do I have to do to get these things expoed to COM and
actually working?

It is just the fact that the auto generated iterop stuff doesn't guess
correctly, and I should build and interface for those classes that
inherit other things so .NET knows what to expose?

-=Chris

Jan 16 '06 #1
2 2999
Christopher H. Laco wrote:
Long story longer, I'm tearing my hair out trying to get some of my
assemblies to work in ASP/COM. I have 4 classes/assemblies:

#1. CustomerMembershipProvider (Inherits MembershipProvider)
#2. CustomTcpClient (Inherits TcpClient)
#3. ASPFormsAuthentication (does magic to read/write
FormsAuthenticationTickets in ASP 3.0)
#4. ASPMembership (does magic to use Membership API within ASP 3.0)

Now, all of these assemblies are set to "Make assembly COM-Visable" and
"Register for COM Interop". Everything build and registers just fine.
Now, from with ASP, I can Server.CreateObject #3 and #4.
Server.CreateObject for #1 and #2 simply yield me:
Server object error 'ASP 0177 : 80131509'
Server.CreateObject Failed
/Default.asp, line 35
80131509


While the ASPMembership class can be created under COM, the minute it
trys to return a CustomMembershipProvider from itself, the page also
bails with the same error above.

Now, after some tinkering, I noticed the common ground here is that #1
and #2 Inherit something else while #3 and #4 don't.

Clearly there is some COM Interop/InteropServices/Inferace magic I'm
missing. What do I have to do to get these things expoed to COM and
actually working?

It is just the fact that the auto generated iterop stuff doesn't guess
correctly, and I should build and interface for those classes that
inherit other things so .NET knows what to expose?

-=Chris


For the curious, I've solved this problem (I think).
The key was that all classes that failed Inherited something else. THat
meant a lot of guessing for regasm when generating the typelib.

I created a custom interface for the classes in question. Then I set the
ComDefaultInterface attribute to use the custom interface. Whola. No
more guessing and it works from ASP/COM.

There's probably something in the massive docs about this type of
scenerio, but it would be nice if Interop docs basically said this is
preferred practice on and class that inherits from another...

-=Chris
Jan 16 '06 #2
Christopher,

Thanks a million for posting this solution, we have been working late nights
for a week to get our site upgraded to ASP.Net 2.0 and this helped us solve
our last showstopper issue at the 11th hour.

Max Lancaster
Senior Developer
The Motley Fool
www.fool.com

"Christopher H. Laco" wrote:
Christopher H. Laco wrote:
Long story longer, I'm tearing my hair out trying to get some of my
assemblies to work in ASP/COM. I have 4 classes/assemblies:

#1. CustomerMembershipProvider (Inherits MembershipProvider)
#2. CustomTcpClient (Inherits TcpClient)
#3. ASPFormsAuthentication (does magic to read/write
FormsAuthenticationTickets in ASP 3.0)
#4. ASPMembership (does magic to use Membership API within ASP 3.0)

Now, all of these assemblies are set to "Make assembly COM-Visable" and
"Register for COM Interop". Everything build and registers just fine.
Now, from with ASP, I can Server.CreateObject #3 and #4.
Server.CreateObject for #1 and #2 simply yield me:
Server object error 'ASP 0177 : 80131509'
Server.CreateObject Failed
/Default.asp, line 35
80131509


While the ASPMembership class can be created under COM, the minute it
trys to return a CustomMembershipProvider from itself, the page also
bails with the same error above.

Now, after some tinkering, I noticed the common ground here is that #1
and #2 Inherit something else while #3 and #4 don't.

Clearly there is some COM Interop/InteropServices/Inferace magic I'm
missing. What do I have to do to get these things expoed to COM and
actually working?

It is just the fact that the auto generated iterop stuff doesn't guess
correctly, and I should build and interface for those classes that
inherit other things so .NET knows what to expose?

-=Chris


For the curious, I've solved this problem (I think).
The key was that all classes that failed Inherited something else. THat
meant a lot of guessing for regasm when generating the typelib.

I created a custom interface for the classes in question. Then I set the
ComDefaultInterface attribute to use the custom interface. Whola. No
more guessing and it works from ASP/COM.

There's probably something in the massive docs about this type of
scenerio, but it would be nice if Interop docs basically said this is
preferred practice on and class that inherits from another...

-=Chris

Jan 27 '06 #3

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

Similar topics

17
by: Patrick | last post by:
I am almost certain that I could use HTTP Post/Get to submit XML Web Service call (over SSL as well, if using Version 3 of MSXML2) from an ASP Application? However, would I only be able to call...
0
by: H Wu | last post by:
I have an application in VB6 (Single Thread Apartment) reference an Interop code (register as COM written in C# that use Asynchronous Call) that help process calls back and forward with VB6 app and...
6
by: Sudha | last post by:
Hi All, I am trying to use COM DLL in my C#. I have added this DLL in referance and all interface are working fine. I have one issue in calling function decleared like: void...
8
by: Rob Edwards | last post by:
When trying to add the Microsoft CDO for Exchange Management Library (aka CDOEXM.dll) I receive the following message: "A reference to 'Microsoft CDO for Exchange Management Library' could not be...
2
by: Jas Manghera | last post by:
Hello everyone, Im having a rather strange problem with my custom ASP.NET application. After deploying the application on a .NET v1.1 computer, the first time the application is launched it can...
5
by: Yoavo | last post by:
Hi, In my application I have to use som external COM dll's. In the code: using MyDll when I build the project, I get (in addition to the .exe file) a Dll called Interop.MyDll.dll I want to...
2
by: RodneyAnonymous | last post by:
I've got some code for composing an e-mail from the contents of an RTF box. The first time I execute it, everything works fine. If I close my app and then re-run it, however, I always receive the...
5
by: muriwai | last post by:
Hi, I have a C# assembly project under Visual Stuio 2008 Pro on Windows Server 2008. I converted the project from VS 2005. The project references COM->Microsoft CDO for Windows 2000 Library...
1
by: Bhrionn | last post by:
Hello World, I am working on implementing a build for my companies application. The scenario implemeted is producing the error: ‘Class does not support automation or does not support expected...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.