2

Possible Duplicate:
Get Current .NET CLR version at runtime?

The System.Runtime.Versioning.FrameworkName class is a strongly typed indicator of a .NET Framework version. It differs based on version number, profile (Client Profile) etc. At runtime, how can you get the FrameworkName correct for the runtime environment in which the code is being executed? For example, a FrameworkName corresponding to net40 if you're running in a normal , non-Client Profile setup.

Note - the version of a specific assembly, the version of the compiler used, etc. are not a match here - you might have compiled an assembly with a 2.0 compiler but it may be running in a 4.5 runtime environment.

Community
  • 1
  • 1
kolektiv
  • 309
  • 1
  • 7
  • Not a duplicate of that - that doesn't tell you if you're running under Client Profile, etc. – kolektiv Oct 31 '12 at 16:23
  • This is *not* a duplicate of the question regarding .NET CLR runtime version. The result of that is a version string, which does not tell you if you're running under a specific client profile, silverlight, etc. See the docs on the constructors for a `FrameworkName` instance for more details - a simple runtime version does not give you the data to construct a valid string (you have no Profile information). Info: http://msdn.microsoft.com/en-us/library/dd414023.aspx – kolektiv Nov 01 '12 at 00:32

0 Answers0