diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/TypeResolutionService.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/TypeResolutionService.cs index 7862e938c0..943c8c39aa 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/TypeResolutionService.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/TypeResolutionService.cs @@ -122,6 +122,10 @@ namespace ICSharpCode.FormsDesigner.Services if (!projectContentsCurrentlyLoadingAssembly.Add(pc)) return null; + Assembly sdAssembly; + if (IsSharpDevelopAssembly(pc, out sdAssembly)) + return sdAssembly; + try { // load dependencies of current assembly foreach (IProjectContent rpc in pc.ReferencedContents) { @@ -151,6 +155,20 @@ namespace ICSharpCode.FormsDesigner.Services } } + readonly string sharpDevelopRoot = Directory.GetParent(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)).FullName; + + bool IsSharpDevelopAssembly(IProjectContent pc, out Assembly assembly) + { + assembly = null; + foreach (var asm in AppDomain.CurrentDomain.GetAssemblies()) { + if (!asm.IsDynamic && asm.Location.StartsWith(sharpDevelopRoot, StringComparison.OrdinalIgnoreCase) && pc.AssemblyName == asm.GetName().Name) { + assembly = asm; + return true; + } + } + return false; + } + static string GetHash(string fileName) { return Path.GetFileName(fileName).ToLowerInvariant() + File.GetLastWriteTimeUtc(fileName).Ticks.ToString();