Skip to content

Microsoft.Extensions.Http.Resilience .NET Standard compatible #5022

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
bdovaz opened this issue Mar 12, 2024 · 9 comments · May be fixed by #6218 or #6219
Open

Microsoft.Extensions.Http.Resilience .NET Standard compatible #5022

bdovaz opened this issue Mar 12, 2024 · 9 comments · May be fixed by #6218 or #6219

Comments

@bdovaz
Copy link

bdovaz commented Mar 12, 2024

Why is it not compatible? It makes it impossible for us to use it in Unity (.NET Standard 2.1 only)...

https://www.nuget.org/packages/Microsoft.Extensions.Http.Resilience#dependencies-body-tab

@mike-ayres
Copy link

bump

1 similar comment
@Seabizkit
Copy link

bump

@joperezr
Copy link
Member

joperezr commented Dec 5, 2024

Sorry for the lack of replies here. We haven't forgotten about this and we should be able to post an update here soon.

@Abdragiz
Copy link

Abdragiz commented Feb 7, 2025

@joperezr, Is there a specific reason why many libraries in this repository don't target netstandard2.0? It seems logical to align with the same targeting policy used by other libraries in the Microsoft.Extensions.* family (e.g., Logging, Configuration, DependencyInjection).

@joperezr
Copy link
Member

joperezr commented Mar 3, 2025

The main reason this was decided at the beginning was that most of the runtimes that support .NET Standard 2.0 which are not .NET Framework or .NET were out of support, so adding .NET Standard 2.0 target wouldn't really add much for us. All that said, this was because we thought about most of these packages to be app-specific dependencies (which would always target runnable frameworks), but since then we have gotten feedback that at least some of these packages would also make sense as dependencies of other libraries, which is where most of the advantages of targeting .NET Standard would show. In other words, targeting netstandard 2.0 makes it possible for other libraries to depend on Microsoft.Extensions.*, which is why we are now re-evaluating and considering multi-targeting these.

@bdovaz
Copy link
Author

bdovaz commented Mar 4, 2025

@joperezr I am surprised that you have never taken into account Unity which is why I opened this issue really. Unity does not support .NET Core CLR, it uses an old mono fork so it only supports .NET Standard 2.0 / 2.1 (depending Unity version):

https://docs.unity3d.com/6000.0/Documentation/Manual/dotnet-profile-support.html

All the Microsoft.Extensions.* libraries are compatible with .NET Standard 2.0 or 2.1 so we have always been able to use them without any problem, that's why I was surprised that this one in particular was not compatible...

@bdovaz
Copy link
Author

bdovaz commented Mar 12, 2025

@joperezr I am encountering this problem again in Unity when I try to create tests with this package:

https://github.com/dotnet/extensions/tree/main/src/Libraries/Microsoft.Extensions.Diagnostics.Testing

Not compatible with .NET Standard 2.0 / 2.1:

https://www.nuget.org/packages/Microsoft.Extensions.Diagnostics.Testing/#dependencies-body-tab

To workaround this problem, I had to copy the source code and adapt it to C# 8 which is the Unity version:

  • Remove the telemetry part (not compatible with .NET Standard 2.0 as I said)
  • Remove the file scoped namespaces.
  • Remove the collection expressions.

@joperezr
Copy link
Member

Thanks for sharing, you are right, I don't think we have any push back on adding NS2.0 to some of these libraries where it makes sense, so it is just mainly about prioritizing the work versus our other priorities. Since you mention that you have done at least some of this work already, would you be interested in contributing a PR with the NS support?

@bdovaz
Copy link
Author

bdovaz commented Mar 13, 2025

Thanks for sharing, you are right, I don't think we have any push back on adding NS2.0 to some of these libraries where it makes sense, so it is just mainly about prioritizing the work versus our other priorities. Since you mention that you have done at least some of this work already, would you be interested in contributing a PR with the NS support?

Yes, no problem, I'll get to it as soon as I can.

# for free to join this conversation on GitHub. Already have an account? # to comment