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

Incompatibility with Microsoft.IO.RecyclableMemoryStream 3.0.0 #44

Closed
EklipZgit opened this issue Feb 5, 2024 · 4 comments · Fixed by #45
Closed

Incompatibility with Microsoft.IO.RecyclableMemoryStream 3.0.0 #44

EklipZgit opened this issue Feb 5, 2024 · 4 comments · Fixed by #45
Assignees
Labels
bug Something isn't working
Milestone

Comments

@EklipZgit
Copy link

On .NET 8, using latest non-preview version (8.1.0) says it depends on
Microsoft.IO.RecyclableMemoryStream >= 2.3.2
which allows 3.0.0. However, when run in Json mode, you end up with

System.MissingMethodException: Method not found: 'System.IO.MemoryStream Microsoft.IO.RecyclableMemoryStreamManager.GetStream()'.
   at BlazarTech.QueryableValues.Serializers.JsonSerializer.<Serialize>g__GetJson|2_2[T](IEnumerable`1 values, Action`2 writeValue, Func`2 mustSkipValue)
   at BlazarTech.QueryableValues.Serializers.JsonSerializer.Serialize[T](IEnumerable`1 values, IReadOnlyList`1 propertyMappings)
   at BlazarTech.QueryableValues.DeferredValues`3.ToString(IFormatProvider provider)

with a csproj with

<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.0" />

in it. Unfortunately I have another dependency that requires Microsoft.IO.RecyclableMemoryStream >= 3.0.0 so I can't revert to 2.3.x, so I'll have to drop AsQueryableValues for now. Figured I'd let you know so you can consume latest or constrain that dependency at least!

@yv989c
Copy link
Owner

yv989c commented Feb 5, 2024

Hi @EklipZgit, thanks for the heads up!

I believe the best course of action here would be to upgrade to version 3 of that dependency on the next release. Not sure about adding the version constraint at this time, though.

Will do it in the preview version I'm currently working on and ping you so you can give it a try.

@yv989c yv989c added the bug Something isn't working label Feb 5, 2024
@yv989c yv989c added this to the v1.4.0 milestone Feb 5, 2024
@yv989c yv989c self-assigned this Feb 5, 2024
@AhmedMSedeek
Copy link

Following,

@yv989c
Copy link
Owner

yv989c commented Feb 8, 2024

The maintainers of Microsoft.IO.RecyclableMemoryStream decided to introduce what I consider an unnecessary breaking change. I believe the disadvantages outweigh the benefits.

Given the nature of this breaking change, upgrading to v3.0.0 no longer appears to be a sensible option for this library. If you find yourself in a similar situation as the individual who opened the issue, you won't be able to use QueryableValues.

However, I believe I've identified a potential workaround to avoid this binary breaking change by leveraging an equivalent API that remained unchanged in the transition to v3.x. This approach may allow me to continue using v2.x for broader compatibility while maintaining binary compatibility with v3.x, should your project depend on it.

I'd likely work on this over the weekend. ✌️

@yv989c
Copy link
Owner

yv989c commented Feb 8, 2024

Hey @EklipZgit, the fix is now available in the latest patch release of each major version of QueryableValues. In your case, version 8.1.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants