Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 39fee54

Browse files
committed
Revert "Use Assembly.Load(Byte[]) instead of Assembly.LoadFrom."
This reverts commit b65fa30.
1 parent 0416fda commit 39fee54

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

src/runtime/assemblymanager.cs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ internal class AssemblyManager {
3030
static ResolveEventHandler rhandler;
3131
static Dictionary<string, int> probed;
3232
static List<Assembly> assemblies;
33-
static Dictionary<string, Assembly> loadedAssemblies;
3433
internal static List<string> pypath;
3534

3635
private AssemblyManager() {}
@@ -47,7 +46,6 @@ internal static void Initialize() {
4746
probed = new Dictionary<string, int>(32);
4847
//generics = new Dictionary<string, Dictionary<string, string>>();
4948
assemblies = new List<Assembly>(16);
50-
loadedAssemblies = new Dictionary<string, Assembly>();
5149
pypath = new List<string>(16);
5250

5351
AppDomain domain = AppDomain.CurrentDomain;
@@ -204,19 +202,7 @@ public static Assembly LoadAssemblyPath(string name) {
204202
string path = FindAssembly(name);
205203
Assembly assembly = null;
206204
if (path != null) {
207-
if (loadedAssemblies.ContainsKey(path)) {
208-
return loadedAssemblies[path];
209-
}
210-
// Avoid using Assembly.LoadFrom as referenced assemblies that exist
211-
// in the same path will be loaded directly from there, rather than
212-
// using other versions already loaded. This is a problem if there
213-
// is a Python.Runtime.dll in the same folder as the assembly being
214-
// loaded, as that will result in two instances being loaded.
215-
try {
216-
byte[] bytes = System.IO.File.ReadAllBytes(path);
217-
assembly = Assembly.Load(bytes);
218-
loadedAssemblies[path] = assembly;
219-
}
205+
try { assembly = Assembly.LoadFrom(path); }
220206
catch {}
221207
}
222208
return assembly;

0 commit comments

Comments
 (0)