{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/22293","repository_url":"https://api.github.com/repos/dotnet/corefx","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/22293/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/22293/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/22293/events","html_url":"https://github.com/dotnet/corefx/issues/22293","id":243164149,"number":22293,"title":"How can I detect my code is running on top of .net core?","user":{"login":"ysmoradi","id":5352980,"avatar_url":"https://avatars6.githubusercontent.com/u/5352980?v=4","gravatar_id":"","url":"https://api.github.com/users/ysmoradi","html_url":"https://github.com/ysmoradi","followers_url":"https://api.github.com/users/ysmoradi/followers","following_url":"https://api.github.com/users/ysmoradi/following{/other_user}","gists_url":"https://api.github.com/users/ysmoradi/gists{/gist_id}","starred_url":"https://api.github.com/users/ysmoradi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ysmoradi/subscriptions","organizations_url":"https://api.github.com/users/ysmoradi/orgs","repos_url":"https://api.github.com/users/ysmoradi/repos","events_url":"https://api.github.com/users/ysmoradi/events{/privacy}","received_events_url":"https://api.github.com/users/ysmoradi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-07-15T09:17:09Z","updated_at":"2017-07-16T09:29:25Z","closed_at":null,"body":"```csharp\r\n    public class PlatformUtilities\r\n    {\r\n        public static bool IsRunningOnMono\r\n        {\r\n            get\r\n            {\r\n                return Type.GetType(\"Mono.Runtime\") != null; // I need something like this.\r\n            }\r\n        }\r\n\r\n        public static bool IsRunningOnDotNetCore\r\n        {\r\n            get\r\n            {\r\n                // What should I return here?\r\n            }\r\n        }\r\n    }\r\n```\r\n\r\nThanks in advance."},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/315596944","html_url":"https://github.com/dotnet/corefx/issues/22293#issuecomment-315596944","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/22293","id":315596944,"user":{"login":"karelz","id":5776068,"avatar_url":"https://avatars6.githubusercontent.com/u/5776068?v=4","gravatar_id":"","url":"https://api.github.com/users/karelz","html_url":"https://github.com/karelz","followers_url":"https://api.github.com/users/karelz/followers","following_url":"https://api.github.com/users/karelz/following{/other_user}","gists_url":"https://api.github.com/users/karelz/gists{/gist_id}","starred_url":"https://api.github.com/users/karelz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karelz/subscriptions","organizations_url":"https://api.github.com/users/karelz/orgs","repos_url":"https://api.github.com/users/karelz/repos","events_url":"https://api.github.com/users/karelz/events{/privacy}","received_events_url":"https://api.github.com/users/karelz/received_events","type":"User","site_admin":false},"created_at":"2017-07-16T09:29:25Z","updated_at":"2017-07-16T09:29:25Z","body":"I think you can use [`System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription`](https://apisof.net/catalog/System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription) API, which is part of .NET Standard 1.1+, also see [source code](https://github.com/dotnet/corefx/blob/c46e2e98b77d8c5eb2bc147df13b1505cf9c041e/src/System.Runtime.InteropServices.RuntimeInformation/src/System/Runtime/InteropServices/RuntimeInformation/RuntimeInformation.cs#L22-L35).\r\n\r\nCheck out [`IsNetCore`](https://github.com/dotnet/corefx/blob/master/src/Common/tests/System/PlatformDetection.cs#L24) implementation from our test sources."}}
{"actor":{"display_login":"karelz"}}