Registering .NET DLL in COM

Posted on 2009-02-20
Last Modified: 2013-11-17
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

Question by:MarcGraff
    1 Comment
    LVL 7

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

    Not sure if that helps :/

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (…
    Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now