You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

AppDomainPolyfill.cs 765 B

123456789101112131415161718192021222324252627282930
  1. using System.Linq;
  2. using System.Reflection;
  3. using Microsoft.DotNet.PlatformAbstractions;
  4. using Microsoft.Extensions.DependencyModel;
  5. namespace System
  6. {
  7. /// <summary> Polyfill of the AppDomain class from full framework. </summary>
  8. internal class AppDomain
  9. {
  10. public static AppDomain CurrentDomain { get; private set; }
  11. private AppDomain()
  12. {
  13. }
  14. static AppDomain()
  15. {
  16. CurrentDomain = new AppDomain();
  17. }
  18. public Assembly[] GetAssemblies()
  19. {
  20. var rid = RuntimeEnvironment.GetRuntimeIdentifier();
  21. var ass = DependencyContext.Default.GetRuntimeAssemblyNames(rid);
  22. return ass.Select(xan => Assembly.Load(xan)).ToArray();
  23. }
  24. }
  25. }