By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,616 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

How to run an application built for .net v2 on .net v4 client profile

P: 10
I have created a simple 'hello world' windows form in VB.net using visual studio 10. In the compile tab of the project I have targeted .net framework V2.0. The application runs on my development machine which has all versions of the framework installed. If I copy it to an XP machine with ONLY .net v4.0 client profile installed it will not run but errors immediately with a msgbox "To run this application You must first install one of the following versions of the .net framework: v2.0.50727"

My understanding is that later versions are backward compatible with earlier versions of .net so it should run without needing any config files mentioned below

http://msdn.microsoft.com/en-us/library/9w519wzk
says
"The version of the .NET Framework that an application runs on is determined as follows:

If the version of the .NET Framework that the application was built against is present on the computer, the application runs on that version.

If the version of the .NET Framework that the application was built against is not present and a configuration file does not specify a version in a <supportedRuntime> Element, the application runs on the latest version of the .NET Framework that is present on the computer.

If the version of the .NET Framework that the application was built against is not present and the configuration file specifies a version in a <supportedRuntime> Element, the application runs on the latest version that is specified in the application configuration file and is present on the computer."
Can anyone tell me how to make it run without having to build explicitly for .net v4 please ?
May 16 '12 #1
Share this Question
Share on Google+
1 Reply


P: 10
May have come across the answer myself - this chap has an answer

http://blogs.msdn.com/b/astebner/arc...0/9557946.aspx
Aaron Stebner
25 Sep 2011 10:06 PM

Hi Leo - By default, the .NET Framework 4 does not allow all applications built for earlier verisons of the .NET Framework to migrate forward and run on it if the earlier versions are not installed. If you are using any applications that were built with any version of the .NET Framework before version 4, then I would recommend leaving both the .NET Framework 3.5 SP1 and 4 installed.
Anyone confirm this ? can this default be turned off?
May 16 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.