Schema.NET icon indicating copy to clipboard operation
Schema.NET copied to clipboard

Version 12.0.0 has a dependency on .NET 7 in the .NET 6 build

Open kirk-marple opened this issue 1 year ago • 5 comments

Describe the bug

We have to stay on .NET 6 for now, because of some Azure Durable Entities issues, and I'm unable to upgrade to the latest Schema.NET because it's pulling in System.Text.Json 7.0.0, from the .NET 6.0 target.

Steps to reproduce

image

Expected behaviour

.NET 6.0 target shouldn't pull in any .NET 7 libraries

Schema objects

No response

kirk-marple avatar May 31 '23 19:05 kirk-marple

Hey @kirk-marple - thanks for raising the issue. Strange that you can't upgrade as System.Text.Json v7.0.0 targets .NET 6 so I don't know why it wouldn't be working for you.

Are you hitting a specific error when upgrading to Schema.NET v12 due to this?

Turnerj avatar Jun 03 '23 07:06 Turnerj

Hi @Turnerj, downstream from this I'm using Azure Durable Entities, which isn't supported in .NET 7. I've run into dependency issues where if any 7.x.x .NET assemblies get pulled in, it causes problems finding other assemblies or has missing method exceptions. (Has happened with other packages than Schema.NET.)

So for now I've been keeping all my dependencies clear of anything 7.x.x, and avoiding any problems, until they release the next major version of Durable Entities (hopefully with .NET 8).

kirk-marple avatar Jun 04 '23 06:06 kirk-marple

After talking with some other .NET developers, I think I understand what is going on. Basically Azure Durable Entities is (kinda) replacing our v7 libraries with v6 ones which, through binary breaking changes, causes a whole bunch of problems.

So its less the libraries causing the problem but rather the dumb setup with Azure Durable Entities (and certain other Azure products - I think I remember Azure Functions previously having the same problem come to think of it).

Anyway, I'll get a PR up shortly for optionally having the .NET 6 references for .NET 6 and the .NET 7 references for .NET 7.

Turnerj avatar Jun 08 '23 12:06 Turnerj

I just got bitten by this on another library. I have to check every package update now to see if it's bringing in System.Text.Json 7.0.x. If it happens, my Azure Functions won't load. Thankfully I learned how to use obj/project.assets.json to see where the references come from.

Appreciate you getting this resolved, and look forward to incorporating the new library.

kirk-marple avatar Jun 17 '23 20:06 kirk-marple

I didn't know that the .NET libraries are tied to the .NET version. @Turnerj Can you share the resource you mention to learn about this?

RehanSaeed avatar Sep 19 '23 13:09 RehanSaeed