Running .NET 3.5 Applications on .NET 4 Systems

This question has been asked earlier than several times, but I cannot get a typical solution to work for me. The proposed solution should put this in the "app.config" file:

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

But with a simple Hello World program, I still get the error message: "Could not find a version of the runtime to run this application."

In some cases, I use Windows XP (via Windows Virtual PC in Windows 7), and only installed the .NET 4.0 runtime on XP.

After some research, I found this page: http://msdn.microsoft.com/en-us/library/ee941656.aspx#core

He mentioned: "If your application configuration file is called application-name.config, rename it to application-name.exe.config. For example, rename MyApp.config to MyApp.exe.config.".

I tried this, thinking that this might solve the problem, but I still get "Unable to find runtime version to run this application." when I try to run .NET 3.5 (client profile or full) application on WinXP with .NET 4.0.

+8
backwards-compatibility configuration
Mar 31 '12 at 21:15
source share
1 answer

I hacked it. This may sound silly, but it turns out that the configuration file should be with the final executable in the user folder. After all my research, this has not been found out at all. I thought it was used only for compilation purposes in the developer's folder.

In the list of VS editor files, it can remain as "app.config". However, when compiling, VS automatically creates "{ProgramName} .exe.config" (and puts it in the bin / release folder). This is the file that should be in the end user folder with the executable file.

To summarize, yes, you can run the .NET 3.5 application on the system on which .NET 4.0 is installed.

+6
Apr 3 2018-12-12T00:
source share



All Articles