Utils.cs 745 B

12345678910111213141516171819202122232425
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the Apache 2.0 License.
  3. // See the LICENSE file in the project root for more information.
  4. using System.Linq;
  5. using System.Reactive.Subjects;
  6. using System.Reflection;
  7. using System.Runtime.Versioning;
  8. namespace ReactiveTests
  9. {
  10. static class Utils
  11. {
  12. public static bool IsRunningWithPortableLibraryBinaries()
  13. {
  14. #if DESKTOPCLR20
  15. return false;
  16. #else
  17. var a = typeof(ISubject<int>).GetTypeInfo().Assembly.GetCustomAttributes<TargetFrameworkAttribute>().SingleOrDefault();
  18. return a != null && a.FrameworkDisplayName == ".NET Portable Subset";
  19. #endif
  20. }
  21. }
  22. }