I've downloaded the sample and am trying to run the QueueResults app.
When pressing the Start button it writes "Downloads failed." (Actually there's a HttpRequestException: An error occurred while sending the request.)
And the following messages are in the output:
Exception thrown: 'System.Security.Authentication.AuthenticationException' in System.dll
Exception thrown: 'System.ObjectDisposedException' in System.dll
Exception thrown: 'System.Net.WebException' in System.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in mscorlib.dll
And I've tried other samples in "The Task asynchronous programming model in C#" tutorial and none of them work.
I'm using a firewall and have opened it for the app.
And I've tried to connect to the same url via HttpClient.GetByteArrayAsync(url) in a separate test app, and it succeeds.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The samples actually work if you either:
System.Net.ServicePointManager.SecurityProtocol |= System.Net.SecurityProtocolType.Tls12;/cc @BillWagner
What do you suggest to fix the issue?
Updating the sample and/or adding a note mentioning that Tls12 needs to be enable if the targeted framework version is less than 4.6?
@nemrism I think the better fix is to update the sample. Would you agree?
Definitely, @BillWagner, do you recommend to add the instruction whatever .NET FX version the code is run against?
Would you like me to PR this change?
@nemrism I apologize for the late response. I missed this comment.
The main sample should be updated to recommend a version newer than framework 4.6. The 4.6 instructions should be included.
And yes, I'll watch for a PR if you want to submit one.
Your lucky I still got somewhere in my phone a set of open webpages to handle this.
I'll try to work on this in the coming days and let you know.
We're lucky to have great community contributors. Thank you.
Would you believe me if I told you that participating to msdocs on Github made me reconsider this part of my day-to-day job?