Skip to content

Commit c0f0135

Browse files
#2691: Do not use AssemblyDefintion.GetAssemblyName().
This fails in culture-invariant mode (ilspycmd) when trying to work with satellite assemblies, because System.Reflection.AssemblyName tries to retrieve CultureInfo of the assembly culture.
1 parent a791612 commit c0f0135

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ICSharpCode.Decompiler/Metadata/DotNetCorePathFinderExtensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ public static string DetectTargetFrameworkId(this MetadataReader metadata, strin
7373

7474
if (metadata.IsAssembly)
7575
{
76-
var thisAssemblyName = metadata.GetAssemblyDefinition().GetAssemblyName();
77-
switch (thisAssemblyName.Name)
76+
AssemblyDefinition assemblyDefinition = metadata.GetAssemblyDefinition();
77+
switch (metadata.GetString(assemblyDefinition.Name))
7878
{
7979
case "mscorlib":
80-
return $".NETFramework,Version=v{thisAssemblyName.Version.ToString(2)}";
80+
return $".NETFramework,Version=v{assemblyDefinition.Version.ToString(2)}";
8181
case "netstandard":
82-
return $".NETStandard,Version=v{thisAssemblyName.Version.ToString(2)}";
82+
return $".NETStandard,Version=v{assemblyDefinition.Version.ToString(2)}";
8383
}
8484
}
8585

0 commit comments

Comments
 (0)