1

I want to use some code from a VB6 application in an ASP.NET (written in VB.NET rather than C#.NET) application.

My approach is to copy the DLL file into the BIN folder of the ASP.NET application and add a reference to the COM component (in the BIN folder) in .NET.

Everything seems to work perfectly. Is there anything that I should be aware of with this approach? The ASP.NET application is deployed to a few workstations on the domain using XCOPY. I don't believe that I have to register the DLL on the PC's as it is contained in the BIN folder?

UPDATE

I have read the information in the link provided by n8wrl. The following links talks about adding the ASPCOMPAT tag: http://msdn.microsoft.com/en-us/library/zwk9h2kb.aspx. I assume that you only have to add the tag to pages that reference the COM component i.e. not all pages in the ASP.NET application? Is there anything else that is required to ensure the code in thread safe etc? I realise that .NET uses managed memory and COM uses unmanaged memory and also .NET uses MTA'S whilst COM uses STA's.

4
  • Aren't VB6-based COM components in the STA? What affect would have have on ASP.NET? Commented Apr 19, 2012 at 15:37
  • @n8wrl, this is the reason I have asked this question. Are you saying that there are no concerns because COM objects run in an STA? Commented Apr 19, 2012 at 15:40
  • No, I'm saying the STA is a red flag for me but I don't know how multi-threaded ASP.NET/IIS will treat STA components. Commented Apr 19, 2012 at 15:41
  • COM by itself is not limited to STA's but I think VB-produced COM is. Again, digging into very old memories here. You also need to study the performance implications of ASPCOMPAT closely. It might be worth porting the VB-COM object if you can? Commented Apr 23, 2012 at 20:52

1 Answer 1

1

The following thread might help:

Using VB COM component (STA) in ASP.NET

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.