As we know, at Visual Studio for C# project, we could specify what .NET framework we want to target. Here is the app.config file I got when it is target .NET 4.0:
<configuration><startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
So there is sku attribute there. Does this mean that my code won’t work on machine where .NET 4.0 is NOT installed while .NET 4.5 is installed. I found out that it is confusing from MSDN and I want to get some clarification on this. If so, I would say that is rather bad design. What if I want my code to run on any .NET version of .NET 4.0 and above such as .NET 4.5? I could not distribute different app.config for different env.
When you target a version of .Net you are setting a MINIMUM version required to run your project. You are also restricting yourself to coding with elements of the .Net framework that were available in that version.
At my company we have to target .Net v2.0 on some projects we want to push to all clients because they have old hardware which either isn’t or can’t run later versions of .Net.