Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ LoadFromResolveHandler()

static Assembly System.Reflection.Assembly.LoadFromResolveHandler ( object sender,
ResolveEventArgs args )
inlinestaticprivateinherited

Definition at line 544 of file Assembly.cs.

545 {
546 Assembly requestingAssembly = args.RequestingAssembly;
547 if (requestingAssembly == null)
548 {
549 return null;
550 }
552 {
553 return null;
554 }
555 string fullPath = Path.GetFullPath(requestingAssembly.Location);
556 if (string.IsNullOrEmpty(fullPath))
557 {
558 return null;
559 }
561 {
562 if (!s_loadFromAssemblyList.Contains(fullPath))
563 {
565 {
567 }
568 return null;
569 }
570 }
572 string text = Path.Combine(Path.GetDirectoryName(fullPath), assemblyName.Name + ".dll");
574 {
576 }
577 try
578 {
579 return LoadFrom(text);
580 }
582 {
583 return null;
584 }
585 }
static string Combine(string path1, string path2)
Definition Path.cs:304
static string GetFullPath(string path)
Definition Path.cs:881
static ? string GetDirectoryName(string? path)
Definition Path.cs:121
static readonly List< string > s_loadFromAssemblyList
Definition Assembly.cs:19
static Assembly LoadFrom(string assemblyFile)
Definition Assembly.cs:588
static bool TraceAssemblyLoadFromResolveHandlerInvoked(string assemblyName, bool isTrackedAssembly, string requestingAssemblyPath, string requestedAssemblyPath)
static ? AssemblyLoadContext GetLoadContext(Assembly assembly)

References System.IO.Path.Combine(), System.Runtime.Loader.AssemblyLoadContext.Default, System.Runtime.Serialization.Dictionary, System.IO.Path.GetDirectoryName(), System.IO.Path.GetFullPath(), System.Runtime.Loader.AssemblyLoadContext.GetLoadContext(), System.Runtime.Loader.AssemblyLoadContext.IsTracingEnabled(), System.Reflection.Assembly.LoadFrom(), System.Reflection.Assembly.s_loadFromAssemblyList, System.text, and System.Runtime.Loader.AssemblyLoadContext.TraceAssemblyLoadFromResolveHandlerInvoked().

Referenced by System.Reflection.Assembly.LoadFrom().