views:

176

answers:

3

Do I need to install .NET 2.0 on the device, where .NET 3.5 is installed?

So far my application works on .NET 2.0 (which potentially should be faster) but the long term plan is to port it to .NET 3.5. I need to order devices and the OEM needs to know which version of .NET should be added to the Windows CE image (version 5.0). Shall I ask him to add both .NET 2.0 and .NET 3.5?

A: 

Actually, .NET 3.5 is just a superset of assemblies on top of the .NET 2 framework (unlike .NET 4 which is completely separate).

So if you install .NET 3.5, it will install and should run .NET 2 apps with no problems, afaik.

Artiom Chilaru
this answer would be true if the question was regarding the full desktop framework. On the compact framework it is a whole new set of assemblies. See ctacke's answer for how to do what you want.
trampster
+1  A: 

As far as I know only one version of the .net cf should be added to the image. Either 3.5 or 2.0 and not both.

As for backward compatibility, I believe Artiom answers that.

Shaihi
+1  A: 

Using either an app.config or a device.config file you can promote your application and tell the .NET Compact Framework which runtimes it can use via either the supportedRuntime or compatibility version (some of these are for .NET 1.0 to .NET 2.0, but the mechanism remains the same for .NET 3.5).

Microsoft even has a tool to aid in generating the proper files.

ctacke
How is that even related the the question here? =/
Artiom Chilaru
How is it not related? If you have an assembly built for non 3.5 (i.e. 1.0 or 2.0), you can inform the runtime to promote the assembly and run under 3.5. If you only have 3.5 installed, it's not a given that a 2.0 application will just magically run. It might. It might not. I've seen both cases. An app.config entry ensures that it will.
ctacke