diff options
author | Tomas Rylek <trylek@microsoft.com> | 2016-06-01 00:30:28 +0300 |
---|---|---|
committer | Tomas Rylek <trylek@microsoft.com> | 2016-06-01 00:30:28 +0300 |
commit | d34aaaaf70dc1a2d13b5f9f2b8e8a84b53fceb34 (patch) | |
tree | 582fad7497c10842378ca9193c35402873539bea /src/ILCompiler.MetadataTransform | |
parent | e00fdd8e0cc141a4bf9d357440a1f74006ae0221 (diff) |
Fix ScopeDefinition to properly honor PublicKeyToken based on assembly flags.
[tfs-changeset: 1609348]
Diffstat (limited to 'src/ILCompiler.MetadataTransform')
-rw-r--r-- | src/ILCompiler.MetadataTransform/src/ILCompiler/Metadata/Transform.Scope.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ILCompiler.MetadataTransform/src/ILCompiler/Metadata/Transform.Scope.cs b/src/ILCompiler.MetadataTransform/src/ILCompiler/Metadata/Transform.Scope.cs index 19565baa0..ccb843f4f 100644 --- a/src/ILCompiler.MetadataTransform/src/ILCompiler/Metadata/Transform.Scope.cs +++ b/src/ILCompiler.MetadataTransform/src/ILCompiler/Metadata/Transform.Scope.cs @@ -56,7 +56,14 @@ namespace ILCompiler.Metadata scopeDefinition.Flags |= (AssemblyFlags)((int)AssemblyContentType.WindowsRuntime << 9); } - scopeDefinition.PublicKey = assemblyName.GetPublicKey(); + if ((scopeDefinition.Flags & AssemblyFlags.PublicKey) != 0) + { + scopeDefinition.PublicKey = assemblyName.GetPublicKey(); + } + else + { + scopeDefinition.PublicKey = assemblyName.GetPublicKeyToken(); + } Cts.Ecma.EcmaAssembly ecmaAssembly = module as Cts.Ecma.EcmaAssembly; if (ecmaAssembly != null) |