Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET4: In-Process Side-by-Side Execution Explained

Overview: I'm interested in learning more about the .NET4 "In-Process Side-by-Side Execution" of assemblies, and need additional information to help me demystify it.

Motivation: The application in question is built against .NET2, and uses two third-party libraries that also work against .NET2. The application is deployed (via file copy) to client machines in a virtual environment that includes .NET2. Not my architecture, please bear with me.

Goal: To see if it's possible to rebuild the application assemblies (or a subset) against .NET4, and ship the application as before, without changing the third-party libraries and including the .NET4 Client Profile (as described here) in the deployment.

Steps Taken: The following articles were read, but didn't quite provide me enough information:

  1. In-Process Side-by-Side Execution: Browsed this article, and Scenario Two is the closest it comes to describing something that resembles my situation, but doesn't really cover it with any depth.

  2. ASP.NET Side-by-Side Execution Overview: This article covers a web application, but I'm dealing with a client WinForms application.

  3. CLR Team Blog: In-Process Side-by-Side: This is useful to explain how plug-ins to host processes function under .NET4, but I don't know if this applies to the third-party libraries.

Further Steps: I'm also unclear on how to proceed upgrading a single .NET2 assembly to .NET4, with the executable remaining in .NET2 (i.e. how to configure the solution/project files, if any special code needs to be included, etc.).

like image 543
emptyset Avatar asked Apr 28 '10 16:04

emptyset


People also ask

What do you mean by Side by side execution?

Side-by-side execution is the ability to run multiple versions of an application or component on the same computer. You can have multiple versions of the common language runtime, and multiple versions of applications and components that use a version of the runtime, on the same computer at the same time.

Can multiple versions of the assembly can live side by side?

Because the strong-named assembly's version number is part of its identity, the runtime can store multiple versions of the same assembly in the global assembly cache and load those assemblies at run time.

Which of the following is a component of CLR?

The key components of CLR includes the following: Class Loader - Used to load all classes at run time. MSIL to Native code - The Just In Time (JTI) compiler will convert MSIL code into native code. Code Manager - It manages the code at run time.

Can you have multiple versions of dotnet?

Microsoft designed the . NET Framework so that multiple versions of the framework can be installed and used at the same time. This means that there will be no conflict if multiple applications install different versions of the . NET framework on a single computer.


1 Answers

In general, you can load assemblies created against .NET 2 in the .NET 4 runtime. So you should try this first and see if it "just works". Just covert your app to VS 2010 / .NET 4, and try to compile it with the same references to the third party assemblies. Then deploy and it will probably work.

like image 143
RationalGeek Avatar answered Sep 21 '22 15:09

RationalGeek