1

I have a Classic ASP web site that uses a VB6 COM object.

I want to create a new version of the COM object using .NET instead of VB6.

4
  • 2
    Possible duplicate of Building a COM interop library for ASP Classic using 4.0 framework and Visual Studio 2010 Commented Apr 21, 2016 at 6:26
  • This method is MUCH simpler than the one you refer. And keep in mind there is always more than 1 solution to a problem. Commented Apr 23, 2016 at 2:50
  • @Mystico, the question is a duplicate. Your answer might not be. Why don't you post your method on that question? That way everybody benefits from your option in one place. That's why we close duplicate questions. Commented Apr 24, 2016 at 13:25
  • I just did that and now I will delete this question. Thanks! Commented Apr 26, 2016 at 4:59

1 Answer 1

1

[01]

Start Visual Studio 2015 (run as admin).

Create a new "Class Library" project.

Name it: "DotNetCom"

[02]

Add a new "COM Class" item.

Name it: "HelloCOM.vb"

[03]

Add a public function to "HelloCOM.vb".

For example:

Public Function Hello() As String
    Return "Hello there!"
End Function

[04]

Open "MyProject".

Go to "Compile".

Select "Target CPU: x86".

[05]

Build the "DotNetCom.dll".

[06]

Start Component Services.

Add a new COM+ application.

Name it: "DotNetCom".

[07]

Open the "DotNetCom" properties.

Go to the "Security Tab".

UNCHECK "Enforce access checks for this application".

[08]

Add a new component.

Select "DotNetComTest.tlb" (do NOT select "DotNetComTest.dll").

[09]

Use the COM object from the Classic ASP page.

<%
Dim HelloCOM
Set HelloCOM = Server.CreateObject("DotNetCom.HelloCOM")
Response.Write HelloCom.Hello
%>
Sign up to request clarification or add additional context in comments.

1 Comment

You don't need to register your COM object in Component Services unless your .NET object needs to access the ASP intrinsic objects (Response, Request, etc.) directly or you happen to need COM+ services such as transactions. And if you do need the IIS objects, you have to select all your objects in Component Services, Right click, Properties, Advanced, and check the "Allow IIS Intrinsic Properties" checkbox.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.