AssemblyResolverBase.cs 996 B

1234567891011121314151617181920212223242526
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace HybridCLR.Editor.Meta
  7. {
  8. public abstract class AssemblyResolverBase : IAssemblyResolver
  9. {
  10. public string ResolveAssembly(string assemblyName, bool throwExIfNotFind)
  11. {
  12. if (TryResolveAssembly(assemblyName, out string assemblyPath))
  13. {
  14. return assemblyPath;
  15. }
  16. if (throwExIfNotFind)
  17. {
  18. throw new Exception($"resolve assembly:{assemblyName} 失败! 如果是热更新dll找不到,请先运行`HybridCLR/CompileDll/ActiveBuildTarget`编译生成热更新dll。如果是AOT dll找不到,请先运行`HybridCLR/Generate/LinkXml`,接着在`Build Settings`中打包或者导出工程来生成AOT dll");
  19. }
  20. return null;
  21. }
  22. protected abstract bool TryResolveAssembly(string assemblyName, out string assemblyPath);
  23. }
  24. }