29

Today I encountered with the line

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

in my App.config file which caused errors with framework when the sku attribute was included. Although, I searched a lot I couldnt really find out what SKU means (other than the definitions "stock keeping unit" or "Shelf Keeping Unit" which I dont think are related to this case).

In short, what does SKU mean/stand for ?

Community
  • 1
  • 1
Cemre Mengü
  • 18,062
  • 27
  • 111
  • 169
  • 1
    On this post, it appears that a moderator just pointed to a wiki article. I think what you have already found _is_ the answer...it's just a stock name for the framework version to be used: http://social.msdn.microsoft.com/Forums/en-US/netfxsetup/thread/f28ae863-02a3-47d7-9397-2a68fe1e5531 – DonBoitnott Jun 17 '13 at 13:38
  • 1
    Very, *very* important. .NET 4.5 is quite incompatible with 4.0. You can run a program that targets 4.0 on a machine that has 4.5 installed, lots of [TypeForwardedTo] attributes keep you out of trouble. Trying to go the other way causes very nasty runtime exceptions. – Hans Passant Sep 01 '14 at 11:30

3 Answers3

6

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

Community
  • 1
  • 1
ilmatte
  • 1,732
  • 16
  • 12
4

See the msdn documentation about the supportedRuntime element. It has a table with the valid values for SKU and also what each means.

Jester
  • 56,577
  • 4
  • 81
  • 125
3

SKU stands for Stock-Keeping Unit (SKU), which in turn specifies which .NET Framework release this application supports.

TOP KEK
  • 2,593
  • 5
  • 36
  • 62