Migration of .net Application
                                                                     Muthu Swamy S
                                                                     ms@deepbiz.net
                                                                    +91 98861 97840




  October 20, 2012   .Net Migration
                     Version and Dependencies




                     Migration of .net Application
                     DEEPBIZ | www.deepbiz.net | info@deepbiz.net

                                                                         P a g e |0
Scope

Upgrading your earlier version of .NET applications to .Net Framework 4.5 is easy by opening
the project in Visual Studio 2012. If your project was created in an earlier version, the Project
Compatibility dialog box automatically opens.

However, some changes in the .NET Framework require changes to your code. You may also
want to take advantage of functionality that is new in the .NET Framework 4.5. Making these
types of changes to your application for a new version of the .NET Framework is typically
referred to as migration. If your application does not have to be migrated, you can run it in the
.NET Framework 4.5 without recompiling it.

You have to consider Application Compatibility and Version Compatibility during the migration.
Before start doing the migration you have to ensure the environment readiness for Version and
Dependencies of .NET Framework.

The purpose of this article is to explain how to check the available .NET Frameworks Version
and Dependencies in the System.


.NET Frameworks Version and Dependencies

Each version of the .NET Framework contains the common language runtime (CLR) as its core
component, and includes additional components such as the base class libraries and other
managed libraries. This article describes the key components of the .NET Framework by version,
provides information about the underlying CLR versions and associated development
environments, and identifies the versions that are installed by the Windows operating system
as indicated in the picture.




                                                                                                    Page 01
Version History

The     .NET       Framework
versions 2.0, 3.0, and 3.5
are built with the same
version of the CLR (CLR
2.0).     These       versions
represent successive layers
of a single installation. Each
version is built incrementally on top of the earlier .NET Framework versions. It is not possible
to run versions 2.0, 3.0, and 3.5 side by side on a computer. When you install the .NET
Framework 3.5 SP1, you get the 2.0 and 3.0 layers automatically. However, the .NET
Framework 4 ends this layering approach. Starting with the .NET Framework 4, you can use in-
process side-by-side hosting to run multiple versions of the CLR in a single process. Apps that
were built for versions 2.0, 3.0, and 3.5 can all run on version 3.5, but they will not work on
version 4 or later.

The .NET Framework 4.5 is an in-place update that replaces the .NET Framework 4 on your
computer. After you install this update, your .NET Framework 4 apps should continue to run
without requiring recompilation. However, some changes in the .NET Framework may require
changes to your app code.


Features and IDE
      NET             Introduced                            Description
   Framework           with IDE
     version
 1.0                Visual Studio     Contained the first version of the CLR and the first
                    .NET              version of the base class libraries.
 1.1                Visual Studio     Included updates to ASP.NET and ADO.NET. This
                    .NET 2003         version was subsequently updated twice, with Service
                                      Pack 1 (SP1) and SP2. This version also introduced




                                                                                                   Page 02
side-by-side execution, which enables apps on a single
                                      computer to run against multiple versions of the CLR.
 2.0                Visual Studio     Introduced a new version of the CLR with additions to
                    2005              the base class libraries, including generics, generic
                                      collections, and significant additions to ASP.NET. This
                                      version was updated with SP1 and SP2.
 3.0                Visual Studio     This version is essentially .NET Framework 2.0 with
                    2005              the addition of Windows Presentation Foundation
                                      (WPF), Windows Communications Foundation (WCF),
                                      Windows Workflow Foundation (WF), and CardSpace.
                                      It was updated with SP1 and SP2.
 3.5                Visual Studio     Added new features such as AJAX-enabled websites
                    2008              and LINQ. The SP1 update added Dynamic Data, and
                                      a small set of additional enhancements.
 4                  Visual Studio     Included a new version of the CLR, expanded base
                    2010              class libraries, and new features such as the Managed
                                      Extensibility Framework (MEF), dynamic language
                                      runtime (DLR), and code contracts.
 4.5                Visual Studio     Includes an updated version of the CLR, support for
                    2012              building Windows Store apps, and updates to WPF,
                                      WCF, WF, and ASP.NET.


.NET Framework Versions

You can find out the version numbers in the system using registry editor [regedit.exe] from the
windows registry. The installed versions are listed under the NDP subkey at
HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDP

You can test whether the .NET Framework 4.5 or the .NET Framework 4 is installed by checking
the HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDPv4Full subkey
in the registry for a DWORD value named Release. The existence of this DWORD indicates that
the .NET Framework 4.5 has been installed on that computer. The value of Release is a version
number. To determine if the final release version of the .NET Framework 4.5 is installed, check
for a value that is equal to or greater than 378389 as shown in the picture.




                                                                                                  Page 03
The following code programmatically determines the versions of the .NET Framework that are
installed on a computer. You must have administrative credentials to run this example.
[Download Code here]

Read the Registry key from Microsoft.Win32 API using RegistryKey as shown here.

RegistryKey ndpKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine,
RegistryView.Registry32).OpenSubKey(@"SOFTWAREMicrosoftNET Framework SetupNDP")

It will provide you the result as,




                                                                                             Page 04
.NET Framework Updates

You can read the framework updates from
HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftUpdates using the code

RegistryKey baseKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine,
RegistryView.Registry32).OpenSubKey(@"SOFTWAREMicrosoftUpdates")

Once you run the code, the output shows the available .NET Framework updates in the system as shown in the
picture.




                                                                                                             Page 05
Dot Net Framework Availability Checker Utilitty

The code demonstrates the .Net Frameworks Versions and their updates in the system. You
can download the code from here:
https://docs.google.com/open?id=0BxWxKlOt68qYbzBqa3dFcDVMQXM .

Setup file from here : https://docs.google.com/open?id=0BxWxKlOt68qYVjl5d0dOMGtsa0E




                                                                                          Page 06

.Net Migration

  • 1.
    Migration of .netApplication Muthu Swamy S ms@deepbiz.net +91 98861 97840 October 20, 2012 .Net Migration Version and Dependencies Migration of .net Application DEEPBIZ | www.deepbiz.net | info@deepbiz.net P a g e |0
  • 2.
    Scope Upgrading your earlierversion of .NET applications to .Net Framework 4.5 is easy by opening the project in Visual Studio 2012. If your project was created in an earlier version, the Project Compatibility dialog box automatically opens. However, some changes in the .NET Framework require changes to your code. You may also want to take advantage of functionality that is new in the .NET Framework 4.5. Making these types of changes to your application for a new version of the .NET Framework is typically referred to as migration. If your application does not have to be migrated, you can run it in the .NET Framework 4.5 without recompiling it. You have to consider Application Compatibility and Version Compatibility during the migration. Before start doing the migration you have to ensure the environment readiness for Version and Dependencies of .NET Framework. The purpose of this article is to explain how to check the available .NET Frameworks Version and Dependencies in the System. .NET Frameworks Version and Dependencies Each version of the .NET Framework contains the common language runtime (CLR) as its core component, and includes additional components such as the base class libraries and other managed libraries. This article describes the key components of the .NET Framework by version, provides information about the underlying CLR versions and associated development environments, and identifies the versions that are installed by the Windows operating system as indicated in the picture. Page 01
  • 3.
    Version History The .NET Framework versions 2.0, 3.0, and 3.5 are built with the same version of the CLR (CLR 2.0). These versions represent successive layers of a single installation. Each version is built incrementally on top of the earlier .NET Framework versions. It is not possible to run versions 2.0, 3.0, and 3.5 side by side on a computer. When you install the .NET Framework 3.5 SP1, you get the 2.0 and 3.0 layers automatically. However, the .NET Framework 4 ends this layering approach. Starting with the .NET Framework 4, you can use in- process side-by-side hosting to run multiple versions of the CLR in a single process. Apps that were built for versions 2.0, 3.0, and 3.5 can all run on version 3.5, but they will not work on version 4 or later. The .NET Framework 4.5 is an in-place update that replaces the .NET Framework 4 on your computer. After you install this update, your .NET Framework 4 apps should continue to run without requiring recompilation. However, some changes in the .NET Framework may require changes to your app code. Features and IDE NET Introduced Description Framework with IDE version 1.0 Visual Studio Contained the first version of the CLR and the first .NET version of the base class libraries. 1.1 Visual Studio Included updates to ASP.NET and ADO.NET. This .NET 2003 version was subsequently updated twice, with Service Pack 1 (SP1) and SP2. This version also introduced Page 02
  • 4.
    side-by-side execution, whichenables apps on a single computer to run against multiple versions of the CLR. 2.0 Visual Studio Introduced a new version of the CLR with additions to 2005 the base class libraries, including generics, generic collections, and significant additions to ASP.NET. This version was updated with SP1 and SP2. 3.0 Visual Studio This version is essentially .NET Framework 2.0 with 2005 the addition of Windows Presentation Foundation (WPF), Windows Communications Foundation (WCF), Windows Workflow Foundation (WF), and CardSpace. It was updated with SP1 and SP2. 3.5 Visual Studio Added new features such as AJAX-enabled websites 2008 and LINQ. The SP1 update added Dynamic Data, and a small set of additional enhancements. 4 Visual Studio Included a new version of the CLR, expanded base 2010 class libraries, and new features such as the Managed Extensibility Framework (MEF), dynamic language runtime (DLR), and code contracts. 4.5 Visual Studio Includes an updated version of the CLR, support for 2012 building Windows Store apps, and updates to WPF, WCF, WF, and ASP.NET. .NET Framework Versions You can find out the version numbers in the system using registry editor [regedit.exe] from the windows registry. The installed versions are listed under the NDP subkey at HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDP You can test whether the .NET Framework 4.5 or the .NET Framework 4 is installed by checking the HKEY_LOCAL_MACHINESOFTWAREMicrosoftNET Framework SetupNDPv4Full subkey in the registry for a DWORD value named Release. The existence of this DWORD indicates that the .NET Framework 4.5 has been installed on that computer. The value of Release is a version number. To determine if the final release version of the .NET Framework 4.5 is installed, check for a value that is equal to or greater than 378389 as shown in the picture. Page 03
  • 5.
    The following codeprogrammatically determines the versions of the .NET Framework that are installed on a computer. You must have administrative credentials to run this example. [Download Code here] Read the Registry key from Microsoft.Win32 API using RegistryKey as shown here. RegistryKey ndpKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey(@"SOFTWAREMicrosoftNET Framework SetupNDP") It will provide you the result as, Page 04
  • 6.
    .NET Framework Updates Youcan read the framework updates from HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftUpdates using the code RegistryKey baseKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey(@"SOFTWAREMicrosoftUpdates") Once you run the code, the output shows the available .NET Framework updates in the system as shown in the picture. Page 05
  • 7.
    Dot Net FrameworkAvailability Checker Utilitty The code demonstrates the .Net Frameworks Versions and their updates in the system. You can download the code from here: https://docs.google.com/open?id=0BxWxKlOt68qYbzBqa3dFcDVMQXM . Setup file from here : https://docs.google.com/open?id=0BxWxKlOt68qYVjl5d0dOMGtsa0E Page 06