14

We develop a windows application in .NET 4 with a database of MySQL. When we are about to deploy that application, we install the .NET 4 framework in our client, then when installing the .NET Connector for MySQL, it requires a .NET framework 3.5. But the .NET 4 is already installed. Wasn't .NET framework backward compatible?

We end up installing two .NET framework (3.5 & 4) which isn't small in disk size. What exactly does backward compatibility means?

6
  • 3
    The answer to the unasked question: yes, it's okay to be angry. May 18, 2012 at 6:14
  • Do you have to install the whole .NET 3.5 Framework for one connector? Did you try to copy / register only required assemblies? May 18, 2012 at 6:22
  • 6
    What is .NET framework backward compatibility? A myth.
    – yannis
    May 18, 2012 at 7:27
  • @YannisRizos They hold the obsolete codes/functionality and keep their framework larger and larger for a myth? .NET is weird. May 18, 2012 at 8:33
  • @ErikReppen: angry against whom?
    – Doc Brown
    May 18, 2012 at 12:27

2 Answers 2

20

To quote MSDN:

The .NET Framework 4 is backward-compatible with applications that were built with the .NET Framework versions 1.1, 2.0, 3.0, and 3.5. In other words, applications and components built with previous versions of the .NET Framework will work on the .NET Framework 4.

However, in practice, this compatibility can be broken by seemingly inconsequential changes in the .NET Framework and changes in programming techniques. For example, performance improvements in the .NET Framework 4 can expose a race condition that did not occur on earlier versions. Similarly, using a hard-coded path to .NET Framework assemblies, performing an equality comparison with a particular version of the .NET Framework, and getting the value of a private field by using reflection are not backward-compatible practices. In addition, each version of the .NET Framework includes bug fixes and security-related changes that can affect the compatibility of some applications and components.

You should test your .NET Framework applications and components to ensure that they are compatible with other versions of the .NET Framework. To ensure that an application or component successfully runs on the .NET Framework 4, use the .NET Framework 4 Application Compatibility Walkthrough.

You may also see this very useful thread wherein a detailed explanation was given:

https://stackoverflow.com/questions/2816914/backwards-compatibility-of-net-framework-4

3

Looking at http://dev.mysql.com/doc/refman/5.6/en/connector-net-versions.html, I guess you don't need version 3.5, version 2.0 should be enough (which is much smaller and part of 3.5).

If nothing else helps, you could try to compile the connector by yourself against FW 4.0, see http://dev.mysql.com/doc/refman/5.6/en/connector-net-installation-source.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.