VB6 DLL asptypelibrary.request in asp.net

Nov 17, 2009
Reaction score
I'm have a problem which drives me crazy: I have a VB6 COM DLL with some classes which are working properly using classic asp. If I try to call those classes from within asp.net it fails when calling asptypelibrary.request object.

the VB6 DLL looks like this:

Dim Session As ASPTypeLibrary.Session
Dim Application As ASPTypeLibrary.Application
Dim Request As ASPTypeLibrary.Request
Dim Response As ASPTypeLibrary.Response
Dim Server As ASPTypeLibrary.Server
Dim ScriptingContext As ASPTypeLibrary.ScriptingContext

Public Sub OnStartPage(ByVal MyScriptingContext As ScriptingContext)
   Set Session = MyScriptingContext.Session
   Set Application = MyScriptingContext.Application
   Set Request = MyScriptingContext.Request
   Set Response = MyScriptingContext.Response
   Set Server = MyScriptingContext.Server

End Sub

Public Sub OnEndPage()
   Set Session = Nothing
   Set Application = Nothing
   Set Request = Nothing
   Set Response = Nothing
   Set Server = Nothing
End Sub

Public Sub ExecuteMain()
    Response.Write ("This is a test<p>")
    Response.Write Request.ServerVariables("server_name")
End Sub

The asp.net code looks like this:

<%@ Page AspCompat="true" Debug="true"%>



	Dim oWebDLL As Object = Server.CreateObject("Projekt1.Class1")



I get the following error:

Server Error in '/' Application.

Typen unverträglich 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Runtime.InteropServices.COMException: Typen unverträglich

Source Error: 

Line 12: 
Line 13: 	Dim oWebDLL As Object = Server.CreateObject("Projekt1.Class1")
Line 14:         Response.Write(oWebDLL.ExecuteMain) 
Line 15: 
Line 16:        %>

Source File: C:\SolarView\webx\Default.aspx    Line: 14 

Stack Trace: 

[COMException (0x800a000d): Typen unverträglich]
   Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack) +979
   Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) +216
   ASP.default_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in C:\SolarView\webx\Default.aspx:14
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +98
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +21
   System.Web.UI.Page.Render(HtmlTextWriter writer) +27
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +53
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +280
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +24
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7423


Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

What am I doing wrong here?

Thanks very much,

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Latest member

Latest Threads