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

◆ ResolveAssemblyToPath()

string? System.Runtime.Loader.AssemblyDependencyResolver.ResolveAssemblyToPath ( AssemblyName assemblyName)
inline

Definition at line 82 of file AssemblyDependencyResolver.cs.

83 {
84 if (assemblyName == null)
85 {
86 throw new ArgumentNullException("assemblyName");
87 }
88 string value;
89 if (!string.IsNullOrEmpty(assemblyName.CultureName) && !string.Equals(assemblyName.CultureName, "neutral", StringComparison.OrdinalIgnoreCase))
90 {
92 foreach (string path in resourceSearchPaths)
93 {
94 string text = Path.Combine(path, assemblyName.CultureName, assemblyName.Name + ".dll");
95 if (File.Exists(text))
96 {
97 return text;
98 }
99 }
100 }
101 else if (assemblyName.Name != null && _assemblyPaths.TryGetValue(assemblyName.Name, out value) && File.Exists(value))
102 {
103 return value;
104 }
105 return null;
106 }
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
static bool Exists([NotNullWhen(true)] string? path)
Definition File.cs:97
static string Combine(string path1, string path2)
Definition Path.cs:304

References System.Runtime.Loader.AssemblyDependencyResolver._assemblyPaths, System.Runtime.Loader.AssemblyDependencyResolver._resourceSearchPaths, System.IO.Path.Combine(), System.IO.File.Exists(), System.text, System.Collections.Generic.Dictionary< TKey, TValue >.TryGetValue(), and System.value.

Referenced by Internal.Runtime.InteropServices.IsolatedComponentLoadContext.Load().