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:
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.
ASP.NET Side-by-Side Execution Overview: This article covers a web application, but I'm dealing with a client WinForms application.
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.).
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With