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

Remove .NET 4.6.1 support; netstandard2.0/.NET 4.7.2 new minimum #1161

Merged
merged 9 commits into from
Jul 3, 2020

Conversation

tillig
Copy link
Member

@tillig tillig commented Jul 2, 2020

This enables a Mac with VS Code and Mono to at least build Autofac. It doesn't allow .NET 4.6.1 tests to run but it can build.

I'm starting to think maybe dropping .NET 4.6.1 specific support might be OK for Autofac 6. .NET 4.7.2 does support netstandard2.0, it's been out since 2018, and we could still build for that, which would keep WCF and other .NET desktop framework extensions working. (That's an orthogonal discussion, but it'd make this VS Code integration way easier. I could do that as part of this PR if needed.)

There's a small fix that also snuck in here, where I noticed the DefaultDiagnosticTracer might have a memory leak with respect to how it tracks what traces are in progress. I had a whole... there was a whole thing where I started a branch to work on diagnostics, then thought about getting build support in there, then... anyway, it was hard to back that out and cherry pick and I just left it. I can re-branch and fix all this up if needed. My Git-fu is somewhat lacking.

@tillig
Copy link
Member Author

tillig commented Jul 2, 2020

Oh, I also saw we still had a bunch of partial trust tests hanging out, which don't really make sense when the assembly isn't explicitly annotated for that. These were remnants from the old days of code access security and AllowPartiallyTrustedCallersAttribute that just don't exist anymore.

@tillig
Copy link
Member Author

tillig commented Jul 2, 2020

By way of information for .NET 4.6.1... it appears .NET 4.6.1 is supported as part of the operating system(s) with which it ships:

  • Windows 7 SP1
  • Windows Server 2008 R2 SP1
  • Windows 8.1 Update
  • Windows Server 2012
  • Windows Server 2012 R2
  • Windows 10

When they say "Windows 10," they mean "Windows 10 with no updates," or at least I assume so, since on that same page they talk about how .NET 4.6.2 is supported as part of "Windows 10 (Update 1607)."

Server 2012 R2 ended mainstream support on October 9, 2018. Windows 10 (Update 1607) ended mainstream support on April 9, 2019. (It's hard to tell when "unpatched Windows 10" ended mainstream support, but I have to assume it was before that.)

Point being, this effectively puts .NET 4.6.1 in an unsupported position as of about April 2019 at the latest. It's likely reasonable to assume that folks have moved on, or if they can't then they're still on unsupported operating systems and they have other problems to solve than wondering why they can't take Autofac 6.

@alistairjevans
Copy link
Member

I think if people can still use a .NET Framework version with Autofac, thats good enough.

So if we target ns2.0, and that runs on 4.7.2, that's more than sufficient from my perspective.

@tillig
Copy link
Member Author

tillig commented Jul 2, 2020

Fair enough. Should I include that in this PR?

@alistairjevans
Copy link
Member

I would; but perhaps rename the PR? That supported platform change is now kinda the major change of this PR...

@tillig tillig changed the title Enable build for VS Code/Mac Remove .NET 4.6.1 support; netstandard2.0/.NET 4.7.2 new minimum Jul 2, 2020
@tillig
Copy link
Member Author

tillig commented Jul 2, 2020

The removal of .NET 4.6.1 is now included.

  • Removed target framework
  • Removed #if references to NET461
  • Removed references specific to .NET 4.6.1.

Huge benefit here - you can do a full build and test of the whole thing on Windows or Mac now, opening up the opportunity for a new set of contributors to participate.

I did update the scanned assembly to netstandard2.1 because the Omnisharp analyzer mechanism got bent out of shape that the tests (netcoreapp3.0) were trying to use Autofac at netstandard2.1 but the scanned assembly was forcing a downgrade to netstandard2.0. It doesn't really matter, just gets it to quit complaining.

@tillig
Copy link
Member Author

tillig commented Jul 2, 2020

I do see a lot of IDEXXXX "info" suggestions for improvement now, things I didn't see before. Looks like stuff coming from .editorconfig that just hasn't been fixed yet. I might do a housekeeping PR later to clean some of that up, modernize the code.

@alsami
Copy link
Member

alsami commented Jul 3, 2020

I'm starting to think maybe dropping .NET 4.6.1 specific support might be OK for Autofac 6. .NET 4.7.2 does support netstandard2.0

TFM net461 mostly also supports netstandard2.0. Some users might not run into problems, some might. Here a good post by terrajobst describing the initial design idea and potential problems with net461 and netstandard2.0

@alistairjevans
Copy link
Member

Is it worth changing to a linux appveyor agent from now? Potentially faster builds?

@alsami
Copy link
Member

alsami commented Jul 3, 2020

Is it worth changing to a linux appveyor agent from now? Potentially faster builds?

I guess the machine image used would be smaller so it should definitely be a bit faster.

@tillig
Copy link
Member Author

tillig commented Jul 3, 2020

We could update the build, for sure... But could that be a separate PR? This has sort of morphed a bit from adding VS Code support so I can work on some diagnostics stuff (my daily driver recently, for reasons I won't get into, is a somewhat underpowered Mac and the VS-in-a-Windows-VM experience there is sub-par) to removing net461 and I feel like I'm heading into yak shaving territory.

@alistairjevans
Copy link
Member

Yes, we can do that at any point really.

@tillig
Copy link
Member Author

tillig commented Jul 3, 2020

Awesome. Let me know if I should approve/merge my own PR. Which, like, I'm totally fine with, just checking with the group. :D

@alistairjevans
Copy link
Member

Yep, crack on! I had a look at the changes this morning and everything looks good. 🧗‍♂️

@tillig tillig merged commit da0a793 into v6 Jul 3, 2020
@tillig tillig deleted the vscode-build branch July 6, 2020 17:02
@alistairjevans alistairjevans added this to the v6.0 milestone Sep 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants