app.config supportedruntime element with .NET framework 3.5 SP1
I have a trivial C# windows application with an app.config file. I want to use the SupportedRuntime element开发者_JS百科 to stipulate which version of the .NET framework to use. In my case, I want to use the .NET Framework 3.5 SP1.
Here is the XML I am using to achieve this;
[startup]
[supportedRuntime version="3.5.30729.1"/]
[/startup]
I have Microsoft .NET Framework 3.5 SP1 installed on my PC, but when I run the app, a message box advises me that I need to upgrade to this version of the .NET framework.
I hope this makes sense. Any ideas what the problem is?
(Edit: obviously the above code uses angle brackets rather than square brackets, but I couldnt see how to do that)
The answer is simple.
The .NET framework runtime version does not change with .NET 3.5 or 3.5 SP1, as these releases add additional libraries (Linq for example) but do not change the core runtime.
Hence entering the runtime version "3.5.30729.1" will never work.
精彩评论