Skip to content
This repository has been archived by the owner on Dec 21, 2020. It is now read-only.

Commit

Permalink
Update asm resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
wtfsck committed Feb 12, 2019
1 parent 200c253 commit f3ecae8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dnSpy/dnSpy/Documents/AssemblyResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ IDsDocument ResolveNormal(IAssembly assembly, ModuleDef sourceModule) {
if (fwkKind == FrameworkKind.DotNetCore && !dotNetCorePathProvider.HasDotNetCore)
fwkKind = FrameworkKind.DotNetFramework4;
IDsDocument document;
IDsDocument existingDocument;
switch (fwkKind) {
case FrameworkKind.Unknown:
case FrameworkKind.DotNetFramework2:
Expand All @@ -489,7 +490,7 @@ IDsDocument ResolveNormal(IAssembly assembly, ModuleDef sourceModule) {
gacVersion = -1;
}

var existingDocument = documentService.FindAssembly(assembly);
existingDocument = documentService.FindAssembly(assembly);
if (existingDocument != null)
return existingDocument;

Expand Down Expand Up @@ -527,6 +528,12 @@ IDsDocument ResolveNormal(IAssembly assembly, ModuleDef sourceModule) {
document = LookupFromSearchPaths(assembly, sourceModule, sourceModuleDirectoryHint, netCoreVersion);
if (document != null)
return documentService.GetOrAddCanDispose(document, assembly);

// If it already exists in assembly explorer, use it
existingDocument = documentService.FindAssembly(assembly);
if (existingDocument != null)
return existingDocument;

break;

default:
Expand Down

0 comments on commit f3ecae8

Please sign in to comment.