简体   繁体   中英

ASP.NET using VB6 code

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

The following thread might help:

Using VB COM component (STA) in ASP.NET

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM