Reputation: 510
Could anyone advise on whether an app that targets .NET 3.0 will work on a users machine that has .NET 2.0 and 4.0 but not 3.0? The installers for 3.0 and 3.5 crash on this particular machine.
Upvotes: 0
Views: 141
Reputation: 43076
The 4.0 framework is nominally backward compatible with assemblies compiled for earlier versions (1.1 and later). There is still the possibility that some change in the CLR will break your application. See http://msdn.microsoft.com/en-us/library/ff602939.aspx for more information.
Moral of the story: Test your 3.5 application on the 4.0 CLR to make sure it works properly.
Upvotes: 0
Reputation: 3040
Is so probable that .Net4 has all things that your program requires, there is an option to redirect the uses of assemblies (a little tedious but there is) you can modify the configuration file of your application usually named App.config in development and ApplicationName.exe.config when deployed.
In the section configuration try this for all assemblies that should be redirected:
<runtime>
<generatePublisherEvidence enabled="false"/>
<gcServer enabled="true"/>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System" publicKeyToken="b77a5c561934e089" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="4.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
Upvotes: 0
Reputation: 1642
/EDIT
I was curious and quickly tried myself. It actually depends on whether you build your app against 3.0/3.5 and really use 3.0/3.5 specific stuff (for instance Linq) in the end. If you don't use it, then it will still work of course.
But if you do, then the user will see the Microsoft error reporting dialog.
As it seems there's "no direct targeting .NET 3.0/3.5", because it depends on the targeted dependencies (project references).
But finally the answer should still be: "No, because you never know!"
Upvotes: 2