Sdílet prostřednictvím


Side-by-Side Execution for COM Interop

Side-by-side execution enables COM applications to safely access multiple versions of managed components through COM interop services. For a summary of side-by-side concepts and configuration models, see Side-by-Side Execution.

Beginning with the .NET Framework version 4, side-by-side execution for COM interop is extended to some in-process scenarios. You can develop a new managed COM component using the .NET Framework 4 and run it side-by-side in the same process with a managed COM component that was developed using an earlier version of the .NET Framework. Each component runs with its own version of the .NET Framework, for maximum compatibility.

This is particularly useful for managed COM components that function as in-process add-ins for applications such as Microsoft Excel. Before the .NET Framework 4, managed COM components that ran in the same process had to use the same version of the common language runtime. Thus, if two managed COM components were compiled using different versions of the .NET Framework, they both had to run on the more recent version. This could sometimes cause compatibility problems for the earlier component. 

The CLR from the .NET Framework 4 can run in-process either with the CLR from the .NET Framework version 1.1 or with CLR version 2.0 (which is shared by all versions of the .NET Framework from the .NET Framework version 2.0 through the .NET Framework version 3.5 Service Pack 1). This means that you can begin using new features of the .NET Framework 4 to develop add-ins that will run side-by-side with your existing add-ins, without having to worry about running older add-ins on a newer version of the .NET Framework. See In-Process Side-by-Side Execution.

NoteNote

CLR version 2.0 and CLR version 1.1 cannot run side-by-side in the same process. If you have two components, one built with the .NET Framework version 1.1 and the other built with a version of the .NET Framework that uses CLR version 2.0, both components must run on the more recent version if they are running in the same process.

In This Section

  • Side-by-Side Execution
    Explains what side-by-side execution is and how you can use it to run multiple copies of an application, a component, or the entire runtime.

  • Primary Interop Assemblies
    Describes how to create and use primary interop assemblies, for managed COM components developed before the .NET Framework 4.

  • Registration-Free COM Interop
    Describes how COM interop can activate components without using the Windows registry.