DllHelper.cs 434 B

1234567891011121314151617181920
  1. using System.IO;
  2. using System.Reflection;
  3. namespace Model
  4. {
  5. public static class DllHelper
  6. {
  7. public static Assembly GetHotfixAssembly()
  8. {
  9. byte[] dllBytes = File.ReadAllBytes("./Hotfix.dll");
  10. #if __MonoCS__
  11. byte[] pdbBytes = File.ReadAllBytes("./Hotfix.dll.mdb");
  12. #else
  13. byte[] pdbBytes = File.ReadAllBytes("./Hotfix.pdb");
  14. #endif
  15. Assembly assembly = Assembly.Load(dllBytes, pdbBytes);
  16. return assembly;
  17. }
  18. }
  19. }