I work in the Medical field under the scrutiny of the FDA. We go to great lengths to validate and test our products. However, our most recent development using .NET has brought forth a question. How can we explicitily call out usage of a version of the .NET framework and ensure that only that version gets used. (i.e. if we validate 1.1 and the user installs 2.0, I do not want the application to use 2.0, because my application is validated with 1.1)
Fistly you need to make sure that if the user installs a version then the back versions also get installed. The way I would go about doing this is to get the computer to recognise the different versions as entirely different applications, then getting it to execute the corresponding one. I don't know if that's entirely possible, but it seems logical.
Check the .NET Version at runtime. It's in the Environment class. System.Environment.Version will give you the version.