Skip to content

System.Security.Cryptography.Cng nuget pulls in older dlls than present in the .net framework #121447

@Saurbaum

Description

@Saurbaum

Description

I got caught out by this today and have been in the past.

If you are targeting .netframework 4.8 and include System.Security.Cryptography.Cng via nuget because it has a dependency on System.Security.Cryptography.Algorithms that brings in a collection of nuget packages
System.IO
System.Runtime
System.Security.Cryptography.Algorithms
System.Security.Cryptography.Encoding
System.Security.Cryptography.Primitives

which are older than the versions distributed in the latest version of the .net 4.8 framework

Reproduction Steps

Include System.Security.Cryptography.Cng in a c# project targeting .netframework 4.8

Expected behavior

Only real dependencies should be included if they are newer than the released framework

Actual behavior

I suspect originally these versions were newer than the supported framework binaries available at that time. What this means is technically we run the risk of downgrading by accident at build time.

Regression?

No response

Known Workarounds

Manually deleting the references to the packages.

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.SecuritydocumentationDocumentation bug or enhancement, does not impact product or test code

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions