Skip to content

.NET Standard 2.0 support #2651

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

Closed
wants to merge 2 commits into from
Closed

.NET Standard 2.0 support #2651

wants to merge 2 commits into from

Conversation

IS4Code
Copy link

@IS4Code IS4Code commented Jan 27, 2024

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

This pull request re-adds .NET 6 and .NET Standard 2.0 support, by multi-targeting. There are a few changes to facilitate .NET Standard 2.0 support:

  • There are a few conditionally imported packages to provide the missing types: IndexRange, Microsoft.Bcl.HashCode, System.Memory, System.Text.Encoding.CodePages, Ultz.Bcl.Half.
  • Nullable mode is set to annotations for netstandard2.0, since there could be warnings arising from the lack of annotations on .NET Standard 2.0 members.
  • Polyfills and other missing members added to CompatibilityExtensions.cs.
  • Code that refers to SIMD instructions-specific code is conditionally dependent on USE_SIMD_INTRINSICS, enabled only on .NET 6+, since there are no polyfills that I could find.
  • TPixel.GetPixelTypeInfo() is not usable since there can't be static abstract methods on interfaces, but default(TPixel).GetPixelTypeInfo() works fine in that case.

@CLAassistant
Copy link

CLAassistant commented Jan 27, 2024

CLA assistant check
All committers have signed the CLA.

@tannergooding
Copy link
Contributor

tannergooding commented Jan 27, 2024

It's worth noting that this undoes the work done as part of #2072 where an explicit decision was made by the maintainers to drop support for .NET Standard and other older TFMs.

It may also be in violation of the contributing guidance: https://github.com/SixLabors/ImageSharp/blob/main/.github/CONTRIBUTING.md which aims to avoid significant work or contributions being done and large PRs being opened without any form of discussion/input from the maintainers:

Suggest your change in the Ideas Discussions Channel and start writing code.

Do not open an issue on GitHub until you have collected positive feedback about the change. GitHub issues are primarily intended for bug reports and fixes.

@JimBobSquarePants
Copy link
Member

Hi @IS4Code

Firstly, thank you for your contribution and for showing interest in improving ImageSharp. We genuinely appreciate the time and effort you've put into this pull request.

After careful consideration, we've decided not to merge this PR. The decision to support .NET 6+ exclusively is a strategic one for our project. This approach allows us to reduce development overhead, and more importantly, to leverage the latest language features and optimizations available in recent .NET versions. These aspects are crucial for us to enhance performance and stability, which are our top priorities.

Additionally, your PR conflicts with another significant update I've been working on, which relies heavily on features exclusive to newer versions of .NET. Merging your PR would unfortunately undermine the progress and direction of these updates.

That said, we truly value community contributions and encourage you to continue participating in the development of ImageSharp. We'd be more than happy to see contributions that align with our current technological roadmap and project goals.

Please feel free to discuss further if you have any ideas or suggestions that are compatible with our project direction. Your engagement with ImageSharp is greatly appreciated, and we look forward to potentially collaborating on future initiatives that fit our development strategy.

@Squall-Leonhart
Copy link

Your strategy is flawed, @IS4Code feel free to maintain your fork, users will migrate to yours.

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.

5 participants