-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Core] Remove netcoreapp2.1 and net5.0 targets #40635
Conversation
m-redding
commented
Dec 7, 2023
•
edited
Loading
edited
- [Core] Remove netcoreapp2.1 target #39424
API change check APIView has identified API level changes in this PR and created following API reviews. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YAY!
Aren't there some #if NETCOREAPP2_1
checks in Azure Core that we can remove with the target going away? I'm thinking around diagnostics and for AOT?
yeah - https://grep.app/search?q=NETCOREAPP2_1&filter[repo][0]=Azure/azure-sdk-for-net |
Oh yes I forgot about those - thank you, I will add them right now @christothes @jsquire |
Should we consider - at least for a time - to keep net5.0 targets in our tests, if we had them to begin with? I appreciate we don't support those TFMs - unsupported means unsupported - but we also said we wouldn't intentionally break customers. If even just a single commit to sanity check across platforms (I know KV has some platform-dependent features) and then revert the commit in this PR, that would be something. |
@heaths It looks like the test targets are only net462, net6.0, and net7.0, when you say
do you mean add a net5.0 and netcoreapp2.1 target to the test .csproj to run the pipelines once? Sorry I don't understand exactly what you mean there |
That's correct. Even if we just test it as part of the PR then revert that comment. That way, there's no surprises with existing code. |
I don't think it's that easy. You'd have to also alter the eng sys configuration around the text platform maatrix and probably add something to manually install the unsupported frameworks - if we are even able to do so. I'm not opposed to doing a test - but I don't feel strongly that we need to do so. At best, I'd expect it would help us add some notes to the change log about what may no longer work. If we decide to test, it may be easier to do locally rather than through the pipelines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add an entry to the CHANGELOG so it can be checked in as part of this PR. Many thanks!
@jsquire said,
Yeah, that's a good point. You likely already have the target runtimes installed and, if not, you can quickly get them from https://dot.net. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YAY!!!
After it's merged, would it be possible to generate a nightly nuget so I can test if it still works with AppInsights?
@heaths @jsquire I added the targets to
I hid that one and then got the following:
Which I'm 90% sure is coming from having removed:
Because that was the error that was causing me to need to keep that additional version in the first place. I think this means that with this change we would be breaking customers using netcoreapp2.1. I removed the netcoreapp2.1 target and ran the Azure.Core.Tests for net5.0, which had three failures: This one for both async/sync, with the failure: #if NETCOREAPP
[Test]
public void UsesSocketsClientTransportOnNetCoreApp()
{
var transport = (HttpClientTransport)GetTransport();
HttpClient transportClient = transport.Client;
var handler = (SocketsHttpHandler)GetHandler(transportClient);
Assert.AreEqual(TimeSpan.FromSeconds(300), handler.PooledConnectionLifetime);
Assert.GreaterOrEqual(handler.MaxConnectionsPerServer, 50);
}
#else
[Test]
public void UsesHttpClientTransportOnNetStandart()
{
var transport = (HttpClientTransport)GetTransport();
HttpClient transportClient = transport.Client;
var handler = (HttpClientHandler)GetHandler(transportClient);
Assert.AreEqual(50, handler.MaxConnectionsPerServer);
}
#endif And this one with public void CreateOperationCanceledExceptionPassesTokenOnSupportedVersions()
{
using var cts = new CancellationTokenSource();
cts.Cancel();
var ex = (TaskCanceledException) CancellationHelper.CreateOperationCanceledException(new Exception("test"), cts.Token);
#if NETCOREAPP2_1_OR_GREATER
Assert.IsTrue(ex.CancellationToken.IsCancellationRequested);
#else
Assert.IsFalse(ex.CancellationToken.IsCancellationRequested);
#endif I think both of these tests seem to be a case of the test just not picking up on the correct target, since these tests haven't been run with a net5.0 target in... awhile? It doesn't seem like the behavior is incorrect since the outcome fits the else cases. Do either of you have thoughts about if this impacts the work in this PR? |
I've no issue with this.
Not entirely sure what that test is doing, but the name of "OnSupportedPlatforms" makes me think we should change the
This one seems to be related the fallback to the
|
@jsquire I'm not really sure what the test is doing either, but it doesn't seem to indicate a behavioral change or change in support to me. I think since the change doesn't impact the current test targets, I think I'll leave those preprocessor targets for now. I'll update the changelog to more clearly indicate that netcoreapp2.1 isn't supported anymore. |