Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you call a .NET 2.0 COM object from an ASP.NET 1.1 web app?

We have an ASP.NET 1.1 web application. It invokes a C++ COM object which in turn invokes a .NET COM object. Originally, this .NET COM object was a .NET 1.1 assembly. Now, we need to modify this .NET COM object and in the process we now use Visual Studio 2008 so it is a .NET 2.0 COM object now. We now find that our ASP.NET 1.1 web application can still invokde the C++ COM object, but the C++ COM object is unable to call CoCreateInstance() on the new .NET 2.0 COM object. When we configure the web app to use .NET 2.0 Framework, the C++ COM object can invoke the .NET 2.0 COM object, but doing so breaks the web app.

At the moment, I'm planning on rebulding the .NET COM object using Visual Studio .NET 2003 so I can make it a .NET 1.1 assembly. But I would rather not do that if possible. I know we should also upgrade our web app to .NET 2.0 too, but that's going to take longer.

So, is there any way for our ASP.NET 1.1 web app to be able to invoke the .NET 2.0 COM object through the C++ COM object?

Thank you for any suggestions.

-Dave Herrmann

like image 269
Dave Herrmann Avatar asked Nov 15 '22 13:11

Dave Herrmann


1 Answers

Not if you run it in-process. The .Net v1.1 and v2.0 runtimes cannot co-exist in a process. Which ever is loaded first, wins.

You should be able to run it in a COM+ activation context in a separate process, however. This might be an expedient solution to your situation.

like image 174
codekaizen Avatar answered Dec 05 '22 01:12

codekaizen