Someone
Posts: 8
Joined: Tue Apr 12, 2011 10:44 am

.NET 4.0 not backwards compatible

Hi Advanced Installer Developers,

the .NET 4 Framework is intentionally not backwards compatible with older framework versions. That means, if you compile your application for version 3.5 SP 1 or lower, this can cause problems on Windows XP and Windows Server 2003 machines, which do not include a CLR Version 2.0 by default (like Vista and Windows 7 do).

Now when you choose .NET Framework SP1 as a prerequiste, you automatically look up the registry keys for .NET 4.0 also, that seems to be your default setting. So if only .NET 4.0 is installed, it won't install your prerequisite .NET framework and your application won't run. You have to remove the lookup values for .NET 4.0 that are inserted by default manually to resolve this problem - but they really should not be default values at all.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: .NET 4.0 not backwards compatible

Hi,

Please note that .NET Framework 4.0 does offer backwards compatibility for applications created with older versions. This is stated by Microsoft in multiple articles:
Version Compatibility in the .NET Framework
What's new in the .NET Framework 4

They also mention that not all applications are guaranteed to work in this compatibility mode and you should first test your application.

The .NET 4.0 searches are used by default because most applications should be able to use this compatibility mode. If your application doesn't work, you can just delete the searches. Deleting something is much easier than adding, especially when you don't know what to add.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Someone
Posts: 8
Joined: Tue Apr 12, 2011 10:44 am

Re: .NET 4.0 not backwards compatible

You're right. Someone hardcoded a version string into our app.config and some posts on the msdn social network were simply misleading.
davidhomer
Posts: 38
Joined: Fri Oct 23, 2009 2:39 pm

Re: .NET 4.0 not backwards compatible

I still see a problem that we have a pre-requisite that says I need at least .NET 3.5

If .NET 4.0 is installed on Windows Server 2008 R2 (and the .NET 3.5 SP1 feature is not installed) the prequisite passes however my software then fails as most of the .NET dlls such as System.ActiveDirectory.AccountManagement are not installed (as .NET 4.0 does not install the files that came with previous .NET framework versions).


Dave
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: .NET 4.0 not backwards compatible

Hi Dave,

Please note that you can manually remove the .NET 4.0 searches from Install Conditions tab in Edit Prerequisite dialog. If there are no .NET 4.0 prerequisite searches, .NET 4.0 will be ignored.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”