{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/12204","repository_url":"https://api.github.com/repos/dotnet/coreclr","labels_url":"https://api.github.com/repos/dotnet/coreclr/issues/12204/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/12204/comments","events_url":"https://api.github.com/repos/dotnet/coreclr/issues/12204/events","html_url":"https://github.com/dotnet/coreclr/issues/12204","id":234932335,"number":12204,"title":"[Question] How to detect .NET Core version at runtime","user":{"login":"AndreyAkinshin","id":2259237,"avatar_url":"https://avatars3.githubusercontent.com/u/2259237?v=3","gravatar_id":"","url":"https://api.github.com/users/AndreyAkinshin","html_url":"https://github.com/AndreyAkinshin","followers_url":"https://api.github.com/users/AndreyAkinshin/followers","following_url":"https://api.github.com/users/AndreyAkinshin/following{/other_user}","gists_url":"https://api.github.com/users/AndreyAkinshin/gists{/gist_id}","starred_url":"https://api.github.com/users/AndreyAkinshin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndreyAkinshin/subscriptions","organizations_url":"https://api.github.com/users/AndreyAkinshin/orgs","repos_url":"https://api.github.com/users/AndreyAkinshin/repos","events_url":"https://api.github.com/users/AndreyAkinshin/events{/privacy}","received_events_url":"https://api.github.com/users/AndreyAkinshin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-09T20:34:28Z","updated_at":"2017-06-10T15:36:20Z","closed_at":null,"body":"I would like to get the .NET Core version at runtime. Is there a proper API?\r\n\r\nThe original problem:  https://github.com/dotnet/BenchmarkDotNet/issues/448"},"comment":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/comments/307572374","html_url":"https://github.com/dotnet/coreclr/issues/12204#issuecomment-307572374","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/12204","id":307572374,"user":{"login":"am11","id":3840695,"avatar_url":"https://avatars3.githubusercontent.com/u/3840695?v=3","gravatar_id":"","url":"https://api.github.com/users/am11","html_url":"https://github.com/am11","followers_url":"https://api.github.com/users/am11/followers","following_url":"https://api.github.com/users/am11/following{/other_user}","gists_url":"https://api.github.com/users/am11/gists{/gist_id}","starred_url":"https://api.github.com/users/am11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/am11/subscriptions","organizations_url":"https://api.github.com/users/am11/orgs","repos_url":"https://api.github.com/users/am11/repos","events_url":"https://api.github.com/users/am11/events{/privacy}","received_events_url":"https://api.github.com/users/am11/received_events","type":"User","site_admin":false},"created_at":"2017-06-10T15:36:20Z","updated_at":"2017-06-10T15:36:20Z","body":"Seems like dontet-cli also reflects over its executing assembly version to get the version: https://github.com/dotnet/cli/blob/cc80822c/src/Microsoft.DotNet.Cli.Utils/Product.cs. The CoreFX issue for the proposed API is apparently awaiting a compelling use-case: dotnet/corefx#17452. Perhaps, you can chime in with yours. :)\r\n\r\nI tried using the suggested `AppContext.TargetFrameworkName` property in console app (with `<TargetFramework>netcoreapp1.1</TargetFramework>` in csproj), but it returns `null`:\r\n\r\n```c#\r\nstatic void Main(string[] args)\r\n{\r\n  Console.WriteLine(AppContext.TargetFrameworkName == null);\r\n  // => True\r\n}\r\n```\r\n"}}
{"actor":{"display_login":"am11"}}