How to fix "is only supported on: 'Windows' 7.0 and later"

83 Views Asked by At

I have to double-target a project that currently runs on net48. I've updated target frameworks this way

<TargetFrameworks>net48;net8.0-windows</TargetFrameworks>

But this gives me a lot of warnings CA1416 like ... is only supported on: 'Windows' 7.0 and later.

I tried

<TargetFrameworks>net48;net8.0-windows8.0</TargetFrameworks>

but result is the same. How can I tell compiler that I only care about Windows versions started with some version? I understand that I can suppress this warning but I don't know want to suppress similar warnings with other Windows versions, not 7.0 but, say, 8.0 or 10.0.x.x.


Some types that raise this warning:

CspParameters, X509CertificateBindingManager, X509CertificateBuilder 
0

There are 0 best solutions below