ShopifySharp icon indicating copy to clipboard operation
ShopifySharp copied to clipboard

Incompatibility with .NET Core 3.1

Open ericpetroelje opened this issue 3 years ago • 7 comments

Is there a version of ShopifySharp that will work with .NET Core 3.1? It looks like the latest version requires some .NET 6 libraries. Trying to use the latest version with a .NET Core 3.1 Azure Function app results in runtime errors about the .NET 6 libraries not being found.

ericpetroelje avatar Jan 25 '22 15:01 ericpetroelje

That’s unintended or perhaps a bug. The package targets only netstandard2.1 at the moment so it should be fully compatible with netcore 3.1. I’ll try a test 3.1 project as soon as I have a moment and see if it works as intended there.

-- Josh Harms

On Tue, Jan 25, 2022, at 09:12, Eric Petroelje wrote:

Is there a version of ShopifySharp that will work with .NET Core 3.1? It looks like the latest version requires some .NET 6 libraries. Trying to use the latest version with a .NET Core 3.1 Azure Function app results in runtime errors about the .NET 6 libraries not being found.

— Reply to this email directly, view it on GitHub https://github.com/nozzlegear/ShopifySharp/issues/710, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASOE7CIVEJYEWXUBEMA4LTUX24XHANCNFSM5MYQ2W3Q. You are receiving this because you are subscribed to this thread.Message ID: @.***>

nozzlegear avatar Jan 25 '22 18:01 nozzlegear

Thanks! Here's specifically what I'm seeing when I try to install the NuGet package in VS 2019. Specifically it seems to be the dependency on Microsoft.Extensions.Http & microsoft.extensions.primitives >= 6.0.0 that is causing trouble

Capture .

ericpetroelje avatar Jan 25 '22 19:01 ericpetroelje

Thanks for the screenshot! Those actually look correct, they're just version 6.0 of those packages but those versions should support .NET Core 3.1 according to their nuget page:

image

Could you copy/paste the runtime exceptions you're getting?

nozzlegear avatar Jan 25 '22 21:01 nozzlegear

Sure thing, here's what I'm seeing after installing ShopifySharp and trying to run the app. Note that this is an Azure function app, so it may have something to do with that as it runs inside the azure function runtime? (after getting this error, I tried explicitly adding Microsoft.Extensions.Logging.Abstractions 6.0.0 to the project, but continued to get this error)

Capture2

ericpetroelje avatar Jan 26 '22 13:01 ericpetroelje

We run into the same problem as well. i spent queit some time try to solve this problem but didn't get any solution so far. The only time i have it running was downgrade the sdk.function to 3.0.3. However, i have the shopfiysharp running but i got error about not able to inject ILogger, it turn out the 3.0.3 still have problem on loading logging 6.0.0

Fengnnn avatar Feb 25 '22 14:02 Fengnnn

Thanks for the awesome library. This is a major issue for us unfortunately. 6.0.0 are supposed to work with .netcore 3.1 apps but they actually don't for Azure Functions :(

We spent a week debugging these issues and it appears that we can't use 6.0.0 packages in Azure functions targeting 3.1 - you can read more about this here.

The only possible way forward is to retarget Azure functions to run on .net5.0 which is a requires considerable work (5.0 is not well supported for Azure functions last time I checked).

Is there any chance to remove the 6.0.0 from this library or abstract it away?

TOuhrouche avatar Mar 02 '22 12:03 TOuhrouche

.net core runs has end of life very soon (2022-12-13):

https://learn.microsoft.com/en-us/lifecycle/products/microsoft-net-and-net-core

in my experience, azure functions work great with net5/net6. Did not test net7 yet.

nebula2 avatar Nov 27 '22 13:11 nebula2