views:

68

answers:

1

My client-side app is built using .NET 3.5, in fact, I want to require that the user has it installed. Before I even start the app, I want to make sure that the framework is present on the box.

I tried to use the

<requiredRuntime version="v3.5..."/>

but it seems that the underlying code can't really tell between .net 2 and .net 3.5 (which, i know, it's the same thing).

So how do I check for presence of the .NET 3.5 framework, preferably in a declarative manner?

+3  A: 

If you are deploying your application through an MSI generated with a Setup and Deployment project you could enforce a .NET Framework Launch Condition. If it is a simple copy of the executable you could probably probe for the presence of System.Core assembly with reflection as this assembly is specific to .NET 3.5 but if the user has no CLR 2.0 installed this will fail.

Darin Dimitrov
I know there's a similar plugin to the NSIS installer framework too that lets you check for .Net framework version and auto-install the .Net framework if it doesn't exist.
Wysawyg