Changing the target .NET Framework for compiled executables

Since Windows 8 does not contain .NET 2 / 3.5 by default, I would like to convert some compiled .NET 2.0 executables to .NET 4.5 without recompiling them with VS 2012. Is there a utility for this task?

+4
source share
3 answers

You can simply create or modify the app.config file and set the supportedRuntime to 4.5. This will cause the 4.0 CLR (which will use the 4.5 framework) to load the assembly and not require any changes to the executable itself.

+5
source

As additional information (a solution provided by Reed Copsey), you can have several supported Runtime elements to support systems where 4.x is not installed:

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

And that will make it work well in Windows 8 or previous versions where .NET 4.x is not installed.

+3
source

I believe that you cannot do this, since this attribute is supported in the assembly itself (TargetFramework), which you can do if you do not have source code to decompile the assembly and recompile it using the required .NET. The framework version.

0
source