Open fubar-coder opened 3 days ago
This is not the first time something like this happened. See for example: https://github.com/dotnet/aspnetcore/issues/40255
I don't think it's correct to update all the extensions packages to 9.0 for all target frameworks. If a user targets net8.0 and still wants the 9.0 packages, they can directly reference that. I think orleans should not force clients the upgrade of all extensions packages if targeting an older tfm.
@benjaminpetit perhaps we need to distinguish dependency versions based on TFM, and multi-target net8.0 & net9.0. Alternatively, we try to pick up only the latest ASP.NET 8.0 compatible bits.
Huh, this seems to have happened before: dotnet/orleans#7608
Huh, this seems to have happened before: #7608
ah yes, forgot about that one 👍
There's two ways of looking at this (I'm coming from the aspnetcore aspect, here; on the surface, yes I think this interface change was questionable, and the analysis is correct - the result of a #if
'd member on an interface and dropping a TFM is that we effectively removed those members from the interface in .NET 8, if you're using the .NET 9 abstractions dll. However, I don't think we can realistically maintain all down-level TFMs in the list forever. Maybe .NET 8 is "different" as the LTS, and we could certainly re-add net8.0 in the next service release...
... but a large part of my brain is just saying "don't do this", i.e. don't use the 9.0 abstractions dll if you're using aspnetcore 8.0; ultimately, the abstractions are meant to describe the platform, so: anything new in 9.0 wouldn't actually exsit for you anyway!
(insert philosophical discussion about making changes to interfaces ever, but: that ship has sailed, so...)
I think the team (possibly @ReubenBond , @DeagleGross and myself) need to discuss this internally, and decide on either:
I'm leaning more towards option 1, but let's discuss!
(note: "2" would be adding ;($CurrentLtsTargetFramework)
to the csproj)
I think both need to be done, (2) the missing 8.0 TFM of the abstractions package could affect other frameworks/libraries as well, so this feels like a 'bug'.
And for Orleans (1): I think a framework should not force its users to upgrade to non-LTS packages. So as long as Orleans (or any other framework) supports 8.0, it should target the accompanying 8.0 packages to avoid possible runtime incompatibilities like this.
It's an interesting support policy question; I'm not sure it makes sense for a net8 package to use the net9 abstractions; there are many cases where this is explicitly supported (especially intentionally OOB packages that re supplemental to the framework), but "abstractions" is a little weird and special, since it kinda reflects the in-box framework.
We'll figure that out internally, though. If I'm wrong and we absolutely want to support 8.0 applications using 9.0 "abstractions", then yes, we'd need to fix this via the ;($CurrentLtsTargetFramework)
I proposed above.
Description
I get the following error after an upgrade of Orleans (to 9.0):
Analysis
This happens, because
Microsoft.Orleans.Client
9.0 referencesMicrosoft.AspNetCore.Connections.Abstractions
9.0, but it's only compiled for the following TFMs:Now let's assume that you have a web project targeting
net8.0
:Microsoft.AspNetCore.Connections.Abstractions
8.0Microsoft.Orleans.Client
9.0Microsoft.AspNetCore.Connections.Abstractions
9.0This results in using/copying the DLLs from
Microsoft.AspNetCore.Connections.Abstractions
9.0. The best TFM from this package isnetstandard2.1
, which only contains a reducedITlsHandshakeFeature
withoutNegotiatedCipherSuite
.Solution
Variant 1
Microsoft.Orleans.Client
should have an additional target frameworknet8.0
, which referencesMicrosoft.AspNetCore.Connections.Abstractions
8.0 instead of 9.0.Variant 2
Let the Microsoft ASP.NET Core guys add an additional TF
net8.0
toMicrosoft.AspNetCore.Connections.Abstractions
.