Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SYSLIB0057 (X509Certificate2 ctor is obsolete) errors in runtime code base #106472

Closed
ViktorHofer opened this issue Aug 15, 2024 · 3 comments · Fixed by #106527
Closed

SYSLIB0057 (X509Certificate2 ctor is obsolete) errors in runtime code base #106472

ViktorHofer opened this issue Aug 15, 2024 · 3 comments · Fixed by #106527
Assignees
Labels
area-System.Net.Security in-pr There is an active PR which will close this issue when it is merged
Milestone

Comments

@ViktorHofer
Copy link
Member

ViktorHofer commented Aug 15, 2024

C:\git\runtime3\src\libraries\Common\tests\System\Net\Configuration.Certificates.cs(50,51): error SYSLIB0057: 'X509Certificate2.X509Certificate2(byte[], string?, X509K
eyStorageFlags)' is obsolete: 'Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.' (https:
//aka.ms/dotnet-warnings/SYSLIB0057) [C:\git\runtime3\src\libraries\System.Net.WebSockets.Client\tests\wasm\System.Net.WebSockets.Client.Wasm.Tests.csproj]
C:\git\runtime3\src\libraries\Common\tests\System\Net\Configuration.Certificates.cs(51,51): error SYSLIB0057: 'X509Certificate2.X509Certificate2(byte[], string?, X509K
eyStorageFlags)' is obsolete: 'Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.' (https:
//aka.ms/dotnet-warnings/SYSLIB0057) [C:\git\runtime3\src\libraries\System.Net.WebSockets.Client\tests\wasm\System.Net.WebSockets.Client.Wasm.Tests.csproj]
C:\git\runtime3\src\libraries\Common\tests\System\Net\Configuration.Certificates.cs(52,50): error SYSLIB0057: 'X509Certificate2.X509Certificate2(byte[], string?, X509K
eyStorageFlags)' is obsolete: 'Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.' (https:
//aka.ms/dotnet-warnings/SYSLIB0057) [C:\git\runtime3\src\libraries\System.Net.WebSockets.Client\tests\wasm\System.Net.WebSockets.Client.Wasm.Tests.csproj]
C:\git\runtime3\src\libraries\Common\tests\System\Net\Configuration.Certificates.cs(53,61): error SYSLIB0057: 'X509Certificate2.X509Certificate2(byte[], string?, X509K
eyStorageFlags)' is obsolete: 'Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.' (https:
//aka.ms/dotnet-warnings/SYSLIB0057) [C:\git\runtime3\src\libraries\System.Net.WebSockets.Client\tests\wasm\System.Net.WebSockets.Client.Wasm.Tests.csproj]
C:\git\runtime3\src\libraries\Common\tests\System\Net\Configuration.Certificates.cs(54,61): error SYSLIB0057: 'X509Certificate2.X509Certificate2(byte[], string?, X509K
eyStorageFlags)' is obsolete: 'Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.' (https:
//aka.ms/dotnet-warnings/SYSLIB0057) [C:\git\runtime3\src\libraries\System.Net.WebSockets.Client\tests\wasm\System.Net.WebSockets.Client.Wasm.Tests.csproj]
C:\git\runtime3\src\libraries\Common\tests\System\Net\Configuration.Certificates.cs(94,40): error SYSLIB0057: 'X509Certificate2.X509Certificate2(byte[])' is obsolete:
'Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.' (https://aka.ms/dotnet-warnings/SYSLI
B0057) [C:\git\runtime3\src\libraries\System.Net.WebSockets.Client\tests\wasm\System.Net.WebSockets.Client.Wasm.Tests.csproj]
C:\git\runtime3\src\libraries\Common\tests\System\Net\Http\TestHelper.cs(145,28): error SYSLIB0057: 'X509Certificate2.X509Certificate2(byte[], string?)' is obsolete: '
Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.' (https://aka.ms/dotnet-warnings/SYSLIB
0057) [C:\git\runtime3\src\libraries\System.Net.WebSockets.Client\tests\wasm\System.Net.WebSockets.Client.Wasm.Tests.csproj]

Repro: build.cmd libs && dotnet.cmd build src\libraries\System.Net.WebSockets.Client\tests\wasm\System.Net.WebSockets.Client.Wasm.Tests.csproj

I also had to add this line to that csproj:

    <Compile Include="$(CommonTestPath)System\Net\Http\TestHelper.cs"
             Link="Common\System\Net\Http\TestHelper.cs" />

cc @bartonjs @vcsjones

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Aug 15, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

@ViktorHofer
Copy link
Member Author

Copy link
Contributor

Tagging subscribers to this area: @dotnet/ncl, @bartonjs, @vcsjones
See info in area-owners.md if you want to be subscribed.

@rzikm rzikm added this to the 10.0.0 milestone Aug 16, 2024
@rzikm rzikm removed the untriaged New issue has not been triaged by the area owner label Aug 16, 2024
@dotnet-policy-service dotnet-policy-service bot added the in-pr There is an active PR which will close this issue when it is merged label Aug 16, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net.Security in-pr There is an active PR which will close this issue when it is merged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants