diff --git a/docs/release-notes/FSharp.Compiler.Service/8.0.200.md b/docs/release-notes/FSharp.Compiler.Service/8.0.200.md index 33e81141302..c0d199a7864 100644 --- a/docs/release-notes/FSharp.Compiler.Service/8.0.200.md +++ b/docs/release-notes/FSharp.Compiler.Service/8.0.200.md @@ -1 +1,2 @@ -- Miscellaneous fixes to parens analysis - https://github.com/dotnet/fsharp/pull/16262 \ No newline at end of file +- Miscellaneous fixes to parens analysis - https://github.com/dotnet/fsharp/pull/16262 +- Fixes #16359 - correctly handle imports with 0 length public key tokens - https://github.com/dotnet/fsharp/pull/16363 \ No newline at end of file diff --git a/src/Compiler/AbstractIL/ilread.fs b/src/Compiler/AbstractIL/ilread.fs index 2e28354e95c..78082e34ca7 100644 --- a/src/Compiler/AbstractIL/ilread.fs +++ b/src/Compiler/AbstractIL/ilread.fs @@ -1946,7 +1946,12 @@ and seekReadAssemblyManifest (ctxt: ILMetadataReader) pectxt idx = Name = name AuxModuleHashAlgorithm = hash SecurityDeclsStored = ctxt.securityDeclsReader_Assembly - PublicKey = pubkey + PublicKey = + // The runtime and C# treat a 0 length publicKey as an unsigned assembly, so if a public record exists with a length of 0 + // treat it as unsigned + match pubkey with + | Some pkBytes when pkBytes.Length > 0 -> pubkey + | _ -> None Version = Some(ILVersionInfo(v1, v2, v3, v4)) Locale = readStringHeapOption ctxt localeIdx CustomAttrsStored = ctxt.customAttrsReader_Assembly