• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 539
  • Last Modified:

Registering .NET DLL in COM

I am attempting to register a .NET DLL in COM so it is exposed to some old ASP code.

I was attempting to use RegSvr32.exe to register the object but received this message:
Arc.dll was loaded, but the DllRegisterServer entry point was not found.
This file cannot be registered.

Doing more research I tried regasm.exe (regasm Arc.dll /tlb:Arc.tlb) to register the object and received the message:
Assembly exported to 'E:\inetpub\COM\Arc.tlb', and the type library was registered successfully

Thinking I made progress I tried to implement one of the classes:
dim oAPI
Set oAPI = Server.CreateObject("Arc.Test")
which resulted in the error message "Server.CreateObject Failed" "on line 2"

I have been struggling with this for many hours; any help would be much appreciated!!!!
<ComClass(Test.ClassId, Test.InterfaceId, Test.EventsId)> _
Public Class Test
#Region "COM GUIDs"
    ' These  GUIDs provide the COM identity for this class 
    ' and its COM interfaces. If you change them, existing 
    ' clients will no longer be able to access the class.
    Public Const ClassId As String = "dffcd182-7464-42a9-af6c-de7c85effac0"
    Public Const InterfaceId As String = "e24b1f99-a641-4786-b5a8-ea21b35029f3"
    Public Const EventsId As String = "fece03ea-90bb-40d6-b112-d7af87fe0424"
#End Region
    ' A creatable COM class must have a Public Sub New() 
    ' with no parameters, otherwise, the class will not be 
    ' registered in the COM registry and cannot be created 
    ' via CreateObject.
    Public Sub New()
    End Sub
    Public Function Hmm() As String
        Return "HA"
    End Function
End Class

Open in new window

1 Solution
Doing some research on this, I found something that seems relevant:

Not all the .net classes can be registered as COM object. ASP can only work with COM objects that supports OLE automation so the it can work with even more limited .net classes. Proxy classes derived from WSE2 Microsoft.Web.Services2.WebServicesClientProtocol cannot be registered with dual interface.
from http://www.dotneteer.com/Weblog/?year=2008&month=1

Not sure if that helps :/

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now