How to replace VB6 Com + DLL with .NET

We have Com + VB6 library used in our classic asp application. After upgrading to IIS 6.0 and Windows Server 2003, this is causing us a problem. How do I replace it with .NET (2.0)?

  • Web service?
  • Compiling a DLL in .NET?
  • Another variant?

Suppose rewriting classic asp pages is out of the question.

EDIT . If you rewrite it as a buildable assembly, wouldn't that leave the same problems with Com +?

0


a source to share


3 answers


It really depends on how the com dll is being used. I assume you need to keep the classic asp application, otherwise you would be rewriting the whole thing.



You don't need a web service if the com dll is running session or http context of the site. I would move the com code to the .NET Library assembly, register it with interop (tlbimport / tlbexport), and use the interop assembly in your classic asp application to talk to the new .NET library.

+1


a source


It depends a lot on what the COM component is doing, but the simplest option is probably the COM library in .NET.

This will most likely require the least amount of change for the caller (asp classic app). If you customize the API to suit your VB 6 COM api, this should be a significant replacement.



In some cases, migrating to a web service or some other setting might be cleaner, but your application needs more changes. Without additional information, it is impossible to determine whether this would be appropriate or not.

+1


a source


I am assuming your VB6 component is using some COM + services. If so, then I would rewrite the VB6 component in .NET as a ServicedComponent and then register it with COM + using Regsvcs.exe.

If your VB6 components are accessing the database (or making other lengthy calls to apartments), then as an added benefit of migrating your VB6 components to .NET, you might see performance issues being eliminated when there are many concurrent requests to your components. For a great description of how and why, you see "Avoid Long Calling Calls" from the "Single Threaded Apartment" (STA) section from Maintaining Application Performance When Migrating from MTS to COM + .

+1


a source







All Articles