Calling .NET DLL from Classic ASP Page

I needed to call a .NET DLL from some ASP pages, the DLL was for a search engine and the ASP site was serving as its interface i have done some research and found a way to deal with this the steps are as following:

  • Create a DLL in .NET and be aware that only one class will be used from it (I wasn't able to use any other class than the first one in the dll)
  • build the project
  • Open .NET Command prompt from the tools of .NET located in the Start Menu Shortcuts of .NET
  • Run the following command:Regasm [Your DLL Path] /codebase
  • in your ASP page create an object from your DLL classset Inst = Server.CreateObject("NameSpace.ClassName")replace the NameSpace by your DLL NameSpace and the ClassName by your class nameNote:this code runs in VBScript and it would defer a little if JScript was used
  • You can call a function from your dll using the instance created like:Inst.CallFunction()