Scott M. wrote:
When attempting to target a specific version of the .NET Framework in my
application configuration file, I get an error saying that: "To run this
application, you must first install one of the following versions of the.NET
framework:..." and then it lists the version that I targetted in my config
file.
I am building this with VS 2008 and the 3.5 framework, but am not using or
referencing any assemblies that are specific to 3.5 - just a very basic
class library project.
I DO have all the prior versions of the framework installed (including the
one I'm targetting in my config file).
What do you think?
I think you've neglected to give us the most important bit of information
needed to diagnose the problem, which is the actual configuration file.
As far as I know you can't target specific frameworks at all. You can only
target specific runtimes, which is not the same thing. A runtime version is
something along the lines of "v2.0.50727" for .NET 2.0.
Under normal circumstances, it simply isn't necessary to specify a runtime
version. This should only be used if your application has compatibility
issues that prevent it from being run by a later runtime than the one it was
written for. If you're using VS 2008, you cannot be developing a .NET 1.x
application, so this probably doesn't apply.
If you want to ensure your 3.5 or 3.0 application will run on a 2.0
configuration, simply remove any references to 3.0 or 3.5 assemblies. The
runtime is the same for the 2.0, 3.0 and 3.5 frameworks. Well, almost --
..NET 3.5 will install the 2.0 SP1 runtime, but this is different only in
build number.
--
J.