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

Update CSharp CodeFix Verifiers code to avoid using ServicePointManager #7388

Open
carlossanlop opened this issue Aug 21, 2024 · 0 comments
Open
Labels
help wanted The issue is up-for-grabs, and can be claimed by commenting

Comments

@carlossanlop
Copy link
Member

carlossanlop commented Aug 21, 2024

This PR was meant as a workaround: #7387

Ideally, we should replace the failing functionality using ServicePointManager to instead use the preferred newer APIs, as the error below indicates.

If we get this fixed in main, it could also be backported to the newest .NET 9 branch, as it was cherry-picked to unblock that branch #7386 .

The error:

/mnt/vss/_work/1/s/src/Test.Utilities/CSharpSecurityCodeFixVerifier`2+Test.cs(24,21): error SYSLIB0014: 'ServicePointManager' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead. Settings on ServicePointManager no longer affect SslStream or HttpClient.' (https://aka.ms/dotnet-warnings/SYSLIB0014) [/mnt/vss/_work/1/s/src/Test.Utilities/Test.Utilities.csproj]
/mnt/vss/_work/1/s/src/Test.Utilities/CSharpSecurityCodeFixVerifier`2+Test.cs(29,21): error SYSLIB0014: 'ServicePointManager' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead. Settings on ServicePointManager no longer affect SslStream or HttpClient.' (https://aka.ms/dotnet-warnings/SYSLIB0014) [/mnt/vss/_work/1/s/src/Test.Utilities/Test.Utilities.csproj]
/mnt/vss/_work/1/s/src/Test.Utilities/CSharpCodeFixVerifier`2+Test.cs(27,21): error SYSLIB0014: 'ServicePointManager' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead. Settings on ServicePointManager no longer affect SslStream or HttpClient.' (https://aka.ms/dotnet-warnings/SYSLIB0014) [/mnt/vss/_work/1/s/src/Test.Utilities/Test.Utilities.csproj]
/mnt/vss/_work/1/s/src/Test.Utilities/CSharpCodeFixVerifier`2+Test.cs(32,21): error SYSLIB0014: 'ServicePointManager' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead. Settings on ServicePointManager no longer affect SslStream or HttpClient.' (https://aka.ms/dotnet-warnings/SYSLIB0014) [/mnt/vss/_work/1/s/src/Test.Utilities/Test.Utilities.csproj]
D:\a\_work\1\s\src\NetAnalyzers\UnitTests\Microsoft.NetCore.Analyzers\Security\DataSetDataTableInWebSerializableObjectGraphTests.cs(93,13): error SYSLIB0014: 'ServicePointManager' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead. Settings on ServicePointManager no longer affect SslStream or HttpClient.' (https://aka.ms/dotnet-warnings/SYSLIB0014) [D:\a\_work\1\s\src\NetAnalyzers\UnitTests\Microsoft.CodeAnalysis.NetAnalyzers.UnitTests.csproj]
D:\a\_work\1\s\src\NetAnalyzers\UnitTests\Microsoft.NetCore.Analyzers\Security\DataSetDataTableInWebSerializableObjectGraphTests.cs(113,13): error SYSLIB0014: 'ServicePointManager' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead. Settings on ServicePointManager no longer affect SslStream or HttpClient.' (https://aka.ms/dotnet-warnings/SYSLIB0014) [D:\a\_work\1\s\src\NetAnalyzers\UnitTests\Microsoft.CodeAnalysis.NetAnalyzers.UnitTests.csproj]
@carlossanlop carlossanlop added the help wanted The issue is up-for-grabs, and can be claimed by commenting label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted The issue is up-for-grabs, and can be claimed by commenting
Projects
None yet
Development

No branches or pull requests

1 participant