What does “SKU” (attribute) mean in C#?

后端 未结 1 1901
伪装坚强ぢ
伪装坚强ぢ 2021-02-11 20:10

Today I encountered with the line

in my App.config file

相关标签:
1条回答
  • 2021-02-11 20:34

    A good answer to this question is here:

    What happens if I remove the auto added supportedRuntime element?

    in the last point: "If you want to be able to run on .NET 4.0, but don't need any new 4.5 APIs"

    Essentially the configuration you found in your App.config has been added automatically because your project has been set to automatically to be built with .net Framework 4.5. If you want your application to run with .net Framework 4.0 (with no 4.5 in-place update) you just right.click the project --< Properties and set the target framework to 4. App.config will be modified in:

    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    

    Interesting read also Rick Strahl's post:

    http://weblog.west-wind.com/posts/2012/Mar/13/NET-45-is-an-inplace-replacement-for-NET-40

    0 讨论(0)
提交回复
热议问题