У меня есть приложение, которое работает на Linux и Windows. Мне нужно знать, где работает приложение, чтобы использовать разностный код. Спасибо
Как получить информацию о среде выполнения .Net Core
Ответы (1)
Вероятно, вы ищете System.Runtime.InteropServices.RuntimeInformation
с функцией IsOsPlatform
для выполнения проверок во время выполнения.
Посмотрите видеоруководство https://channel9.msdn.com/Series/aspnetmonsters/ASPNET-Monsters-Episode-46-Finding-Platform-Information монстров ASP.NET.
person
Ralf Bönning
schedule
29.08.2016
RuntimeInformation
изSystem.Runtime.InteropServices
:RuntimeInformation.IsOSPlatform(OSPlatform.Linux)
илиRuntimeInformation.IsOSPlatform(OSPlatform.Windows)
илиRuntimeInformation.IsOSPlatform(OSPlatform.OSX)
- person Oleg   schedule 29.08.2016