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

Skip to content

Commit dfdcfe7

Browse files
committed
Use the assembly short name to find the embedded Python.Runtime (other assemblies may reference it with the full name).
1 parent 2b11631 commit dfdcfe7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pythonnet/src/console/pythonconsole.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public AssemblyLoader() {
4141
loadedAssemblies = new Dictionary<string, Assembly>();
4242

4343
AppDomain.CurrentDomain.AssemblyResolve += (sender, args) => {
44-
String resourceName = new AssemblyName(args.Name).Name + ".dll";
44+
string shortName = args.Name.Split(',')[0];
45+
String resourceName = shortName + ".dll";
4546

4647
if (loadedAssemblies.ContainsKey(resourceName)) {
4748
return loadedAssemblies[resourceName];

0 commit comments

Comments
 (0)