I am compiling a c# application targeting .NET 3.5 as the runtime
In the app.config I am specifying , the recommended supported version tag for 3.5 as per http://msdn.microsoft.com/en-us/library/w4atty68.aspx
What will happen if a computer does not have version .NET 3.5 given I specify .NET 2.0 as the SupportedRuntime ?
Cheers Scott
A string value that specifies the stock-keeping unit (SKU), which in turn specifies which . NET Framework release this application supports.
The machine configuration file, Machine. config, contains settings that apply to an entire computer. This file is located in the %runtime install path%\Config directory.
The version of .NET Framework (4.5 and later) installed on a machine is listed in the registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full. If the Full subkey is missing, then .NET Framework 4.5 or above isn't installed.
Version 3.5 is basically version 2.0 of the CLR. Regardless of what you define, if you have used any of the features of .NET 3.5 or 3.0 on a machine which has only version 2.0, you will get an error.
Value of the version will be the same for 2.0, 3.0, 3.5 and 3.5 SP1:
<configuration>
<startup>
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>
The SupportedRuntime version lists the CLR version, not the framework version. You use v2.0.50727 for any .NET framework version between 2.0 and 3.5 SP1.
Your app will bomb with a FileNotFound exception when you use an assembly that's only available in 3.0 or 3.5 and you try to run it on 2.0. Including the 3.5 bootstrapper in a Setup project (added by default) is a simple way to avoid this mishap.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With