|
|
|
@ -27,11 +27,16 @@ namespace ICSharpCode.SharpDevelop.Services |
|
|
|
{ |
|
|
|
{ |
|
|
|
string path = null; |
|
|
|
string path = null; |
|
|
|
foreach (System.Reflection.Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) { |
|
|
|
foreach (System.Reflection.Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) { |
|
|
|
|
|
|
|
try { |
|
|
|
string fullFilename = assembly.Location; |
|
|
|
string fullFilename = assembly.Location; |
|
|
|
if (Path.GetFileName(fullFilename).Equals(assemblyName, StringComparison.OrdinalIgnoreCase)) { |
|
|
|
if (Path.GetFileName(fullFilename).Equals(assemblyName, StringComparison.OrdinalIgnoreCase)) { |
|
|
|
path = Path.GetDirectoryName(fullFilename); |
|
|
|
path = Path.GetDirectoryName(fullFilename); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} catch (NotSupportedException) { |
|
|
|
|
|
|
|
// assembly.Location throws NotSupportedException for assemblies emitted using
|
|
|
|
|
|
|
|
// Reflection.Emit by custom controls used in the forms designer
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (path == null) { |
|
|
|
if (path == null) { |
|
|
|
throw new System.Exception("Assembly " + assemblyName + " is not loaded"); |
|
|
|
throw new System.Exception("Assembly " + assemblyName + " is not loaded"); |
|
|
|
@ -64,11 +69,16 @@ namespace ICSharpCode.SharpDevelop.Services |
|
|
|
Assembly AssemblyResolve(object sender, ResolveEventArgs args) |
|
|
|
Assembly AssemblyResolve(object sender, ResolveEventArgs args) |
|
|
|
{ |
|
|
|
{ |
|
|
|
foreach (System.Reflection.Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) { |
|
|
|
foreach (System.Reflection.Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) { |
|
|
|
|
|
|
|
try { |
|
|
|
string fullFilename = assembly.Location; |
|
|
|
string fullFilename = assembly.Location; |
|
|
|
if (Path.GetFileNameWithoutExtension(fullFilename).Equals(args.Name, StringComparison.OrdinalIgnoreCase) || |
|
|
|
if (Path.GetFileNameWithoutExtension(fullFilename).Equals(args.Name, StringComparison.OrdinalIgnoreCase) || |
|
|
|
assembly.FullName == args.Name) { |
|
|
|
assembly.FullName == args.Name) { |
|
|
|
return assembly; |
|
|
|
return assembly; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} catch (NotSupportedException) { |
|
|
|
|
|
|
|
// assembly.Location throws NotSupportedException for assemblies emitted using
|
|
|
|
|
|
|
|
// Reflection.Emit by custom controls used in the forms designer
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|