Running .Net 2.0 executable in .Net 4.0 program

I am trying to run an external executable from my program. My program was compiled on .Net 4.0 platform to enable it in Windows XP. The external application is compiled based on .Net 2.0. When I run this program on my machine (installed Windows 7, .Net 4.5), it works fine, however, when I run it in XP with .Net 4.0 installed, I get the following error: Unable to find a version of the runtime to run this application. I tried changing the app.config file as follows, but with no luck:

 <?xml version="1.0"?> <configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> <supportedRuntime version="v2.0" sku=".NETFramework,Version=v2.0"/> </startup> </configuration> 

Is there any other way around this problem?

+4
source share
1 answer

In general, you should not remove any versions of the .NET Framework installed on your computer, because the application you are using may depend on the specific version and may be broken if this version is uninstalled. You can simultaneously download multiple versions of the .NET Framework on one computer. This means that you can install the .NET Framework without uninstalling previous versions. For more information, see Getting Started with the .NET Framework. http://msdn.microsoft.com/en-us/library/bb822049.aspx

+2
source

Source: https://habr.com/ru/post/1483807/


All Articles