netstandard2.0 NuGet 패키지 버전 9.0.0~9.0.2의 System.Security.Cryptography.Pkcs 빌드에는 .NET Framework에 없는 API가 포함되어 있습니다. .NET Framework에서 실행되는 .NET Standard 라이브러리에서 이러한 API를 호출하면 예외가 발생합니다 MissingMemberException. 이러한 멤버는 실수로 포함되어 패키지 버전 9.0.3에서 제거되었습니다.
도입된 버전
.NET 9
이전 동작
System.Security.Cryptography.Pkcs대상으로 하는 프로젝트에서 netstandard2.0 버전 9.0.0을 참조하는 경우 CmsSigner.PrivateKey 속성을 참조할 때 컴파일에 성공합니다. 그러나 라이브러리가 .NET Framework에서 실행된 경우 속성에 액세스하면 MissingMemberException트리거됩니다.
새 동작
제거된 멤버에 액세스하면 이제 런타임 오류가 아닌 컴파일 오류가 발생합니다.
호환성이 손상되는 변경 유형
이는 호환되지 않는 원본 변경입니다.
변경 이유
NuGet 패키지가 생성되는 방식이 변경되어 멤버가 실수로 포함되었습니다. 이러한 멤버는 .NET Framework에서 작업할 수 없으므로 .NET Standard 2.0에서 사용할 수 있는 것으로 나열되지 않아야 합니다.
권장 작업
이러한 추가 멤버가 필요한 경우 해당 멤버를 포함하는 TFM(예: net8.0)에 대해 특별히 컴파일합니다.
영향을 받는 API
- CmsSigner
- System.Security.Cryptography.Pkcs.CmsSigner.PrivateKey
- System.Security.Cryptography.Pkcs.CmsSigner.SignaturePadding
- System.Security.Cryptography.Pkcs.ContentInfo.GetContentType(ReadOnlySpan<Byte>)
- System.Security.Cryptography.Pkcs.EnvelopedCms.Decode(ReadOnlySpan<Byte>)
- System.Security.Cryptography.Pkcs.EnvelopedCms.Decrypt(RecipientInfo, AsymmetricAlgorithm)
- System.Security.Cryptography.Pkcs.SignedCms.AddCertificate(X509Certificate2)
- System.Security.Cryptography.Pkcs.SignedCms.Decode(ReadOnlySpan<Byte>)
- System.Security.Cryptography.Pkcs.SignedCms.RemoveCertificate(X509Certificate2)
- System.Security.Cryptography.Pkcs.SignerInfo.AddUnsignedAttribute(AsnEncodedData)
- System.Security.Cryptography.Pkcs.SignerInfo.SignatureAlgorithm
- System.Security.Cryptography.Pkcs.SignerInfo.GetSignature()
- System.Security.Cryptography.Pkcs.SignerInfo.RemoveUnsignedAttribute(AsnEncodedData)
- System.Security.Cryptography.Pkcs.SubjectIdentifier.MatchesCertificate(X509Certificate2)
.NET