How to enable a .NET 2 application for .NET 4

 

Some versions of Visual BCD Editor and Dual-boot Repair tool are applications based on .NET Framework 2.0.

Both applications use only a small subset of the framework.

The configuration files for both applications (VisualBcd.exe.config and DualBootRepair.exe.config) have following contents:

 


<?xml version="1.0"?>
<configuration>
<startup>
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>

 

As .NET Framework 2.0 is a subset of .NET Framework 4.0 every application using .NET 2 can be made to run on .NET 4 by simply changing its configuration file.

Adding support for .NET 4 would go like this: (added line in red)

 


<?xml version="1.0"?>
<configuration>
<startup>
<supportedRuntime version="v2.0.50727"/>
<supportedRuntime version="v4.0"/>
</startup>
</configuration>

 

Changing both configuration files would allow the applications to run in a .NET 2 environment as well as in a .NET 4 environment.

By default Windows 8 and Windows 10 have .NET 4 runtime installed.

 

Note: Downgrading an application based on .NET 4 to .NET 2 by simply changing configuration file is not possible in general as .NET 4 is a superset of .NET 2.

 

It takes some time and effort to code apps and maintain a website, and liters of coffee ;)

paypal