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

Support for .Net Standard 2.0 #519

Closed
adarmus opened this issue Dec 16, 2024 · 6 comments
Closed

Support for .Net Standard 2.0 #519

adarmus opened this issue Dec 16, 2024 · 6 comments

Comments

@adarmus
Copy link

adarmus commented Dec 16, 2024

We are referencing Insight from an internal shared library that targets .Net Standard 2.0 (which in turn is consumed by various projects that target various .Net releases, including .Net 8).

Would it be possible for v8.x to support targeting Standard 2.0 (it is still supported by .Net 8 itself - https://dotnet.microsoft.com/en-us/platform/dotnet-standard)?

Dotnet version: [standard2.0]
Database: [SQL Server]
Library version: [8.0.1]

Many thanks, Adam

@jonwagner
Copy link
Owner

I see - it looks like I misunderstood the "standard" vs "version" designations. I should be able to put netstandard2.0 back. it should be easier than supporting "framework" builds give me a few days.

@adarmus
Copy link
Author

adarmus commented Dec 17, 2024 via email

@jonwagner
Copy link
Owner

I researched what other libraries are doing with .net standard.

TL;DR - .netstandard2.0 is dead.

I tried to put it back and support it, but the latest versions of some dependencies (e.g. nUnit for testing) no longer support .netstandard2.0.

Given the rationale in the DevExpress notes and the position popular libraries like nUnit have taken, I think the best approach is to:

  • Support net8.0 and beyond for future projects
  • Support net4.8 for .net framework on windows (see issue Support for dotnet framework4.8 #517 for the rationale here)
  • Support net6.0 for older .net applications of the .netstandard 2.x era

Would net6.0 be sufficient for your use case?

(Also note that Insight v6 still supports .netstandard 2.0 and there haven't been major changes since that version.)

@adarmus
Copy link
Author

adarmus commented Dec 19, 2024

Hi,

I think ".netstandard2.0 is dead" isn't quite right (yet). The Microsoft page says:

My expectation is that widely used libraries will end up multi-targeting for both .NET Standard 2.0 and .NET 5

and

To summarize: Use netstandard2.0 to share code between .NET Framework and all other platforms.

We have a large estate, with both on-prem and cloud hosted solutions and on-prem has to stay on .Net Fx 4.8. This means we have a lot of code sharing between the .Net Fx and .Net 'Core' worlds, and producing libraries in Standard met our needs well.

For compliance reasons we 'must' move off .Net 6 onto .Net 8 to sit on a supported platform, so the question is: how do we share libraries between .Net Fx and .Net 8? I suspect the answer is going to involve multi-targeting, so we can build some solutions that are .Net 8 'all the way down' and some that are .Net Fx 'all the way down' (perhaps with some of the simpler libraries targeting Standard), but that's not your problem to solve (it's mine!).

It does mean that in the short term we are unable to run on .Net 8, but this is due to a combination of factors, primarily that the MS SqlClient package had a bug (dotnet/SqlClient#1930); this triggered the need to upgrade packages, including Insight.

I know that providing widely used libraries has to take into account many usage scenarios and there is an overhead to maintaining support for all the older platforms, so I understand your rationale for how you plan to move Insight forward. I also appreciate your time and thoughtful response.

Regards, Adam

@jonwagner
Copy link
Owner

I added back .netstandard2.0 in v8.0.2. I didn't add the test cases back, but there aren't any code differences between .netstandard and the more recent SDKs.

I think you'll find that your project will need to multi-target net48 and net80. That seems to be what most libraries are doing.

But for now this should be one less tangle in your knot. LMK if you find any issues with the build.

@adarmus
Copy link
Author

adarmus commented Dec 19, 2024

That's great - thank you very much.

Adam

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

No branches or pull requests

2 participants