Browse Source

Fix bug in MetadataModule.GetInternalsVisibleTo: should extract short asm name, like previous versions did.

pull/1405/head
Siegfried Pammer 7 years ago
parent
commit
27d7bf2e9d
  1. 13
      ICSharpCode.Decompiler/TypeSystem/MetadataModule.cs

13
ICSharpCode.Decompiler/TypeSystem/MetadataModule.cs

@ -141,7 +141,7 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -141,7 +141,7 @@ namespace ICSharpCode.Decompiler.TypeSystem
var attrValue = attr.DecodeValue(this.TypeProvider);
if (attrValue.FixedArguments.Length == 1) {
if (attrValue.FixedArguments[0].Value is string s) {
list.Add(s);
list.Add(GetShortName(s));
}
}
}
@ -152,6 +152,17 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -152,6 +152,17 @@ namespace ICSharpCode.Decompiler.TypeSystem
}
return LazyInit.GetOrSet(ref this.internalsVisibleTo, result);
}
static string GetShortName(string fullAssemblyName)
{
if (fullAssemblyName == null)
return null;
int pos = fullAssemblyName.IndexOf(',');
if (pos < 0)
return fullAssemblyName;
else
return fullAssemblyName.Substring(0, pos);
}
#endregion
#region GetDefinition

Loading…
Cancel
Save