Tech Off Thread

2 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

.NET DLL consumed by Classic ASP?

Back to Forum: Tech Off
  • User profile image
    phreaks

    is it possible to have a .NET DLL, run inside component services and be consumed in Classic ASP?

    If so, there must be some restriction on what Data types ASp will recognize?

    If I wanted to return some data to ASP (VB script) from a .NET library, how would I go about that?

  • User profile image
    Yggdrasil

    The way to go about this is to have your .NET DLL wrapped by a COM Callable Wrapper (CCW) which can then be instantiated by a COM scripting language like the Jscript/VBScript in ASP.

    You do this by explicitly marking all your COM-exposed objects with the  [COMVisible] attribute and then registering it as a COM typelib using the RegAsm.exe command-line tool.

    There are a lot of caveats and things to watch for - COM Interop is a complex topic, and I recommend getting a good book - like Adam Nathan's interop bible - to know all the little corners - like how to expose COM interfaces, how to bind to events, and even why you should always define a custom Guid for each exposed class using the [GuidAttribute].

    Googling for COM Interop should net you a few overviews. It's too big to go into in a forum post. Smiley

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.