Does .net 4.5 work side by side with .net 4.0?

20,552

Solution 1

I asked this question on the WPF Forum and was given basiclly the same answer that @hvd gave.

http://social.msdn.microsoft.com/Forums/en/wpf/thread/c05a8c02-de67-47a9-b4ed-fd8b622a7e4a

Solution 2

The accepted answer is very relevant, but let me add an example of a situation where the 4.0 target compiled on a 4.5+ machine is something less useful than a 4.0 with fixed bugs.

If you have any ComReference in your projects, they will invoke tlbimp.exe from .NET 4.5 on the build machine. This may result in your software containing wrappers that reference, for example, a System.Reflection.MethodInfo.CreateDelegate(System.Type) method that only exists in .NET 4.5. You'll get a MissingMethodException on the WinXP machine.

This happened to me when working with the ComAdmin namespace, which are COM objects for access to the COM+ catalog, but I suspect that the problem may be wider.

Share:
20,552
Ali Mst
Author by

Ali Mst

I am an IT Software Architect from Salt Lake City, Utah.

Updated on April 27, 2020

Comments

  • Ali Mst
    Ali Mst about 4 years

    I am interested in installing the .NET 4.5.

    But I have heard that it is an In-Place upgrade.

    Since the users at my company uses Windows XP. I can't release any client side apps that use .NET 4.5.

    I know I can target .net 4.0 when I code, but, if I install .net 4.5, is there risk of things working on my machine that will not work on a Windows XP machine (that only has .net 4.0)?

    (By the way, I looked but did not see this question asked. If it has been asked, please point me to it and I will try to delete this one.)