-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
GraphService.SendAsync resulting in Cannot access a disposed object. #1080
Comments
@nozzlegear Do you see yourself having some time in the near future to share your thoughts on what a potential cause could be? |
Hey, sorry @Diceble! I meant to reply yesterday. I don't see anything sticking out that looks like it could be the direct cause here. Have you set any global ShopifySharp settings, e.g.
If you get any exceptions, try to copy and paste the stack traces here! They'll be helpful for debugging this. |
Hi @nozzlegear, Thanks for the reply! After an update to 6.18 of shopifysharp within my net 4.8 framework the exception stays the same.
As you requested I created a .net 8 project with shopifysharp 6.18, I ran the exact same unit test. This time it did work. So it seems the .NET framework is the root cause of the issue here. Unfortunately, I am not in the position to upgrade my project to any of the newer .NET version since the project is too large and depends on too much of non .net 8 compatible packages that this takes quite some time to refactor, time we unfortunately don't have to spend :'( . Is this a bug that is in the scope of the project to get solved or will this not get resolved? Many thanks! |
Perfect, thanks for the stack trace and thanks for trying the .net 8 app! I'm on a Mac so it's a little difficult for me to test dotnet framework out. No worries about not being able to upgrade right now, we support dotnet framework as one of the official targets for ShopifySharp, so I'm going to fix this bug. I'm pretty sure I know what the issue is thanks to your stack trace. I can't promise an exact timeline for when it'll be fixed, but I'm getting started right now. I don't see it taking longer than a day or two. |
Thank you for the information about your estimate. It's enough for me to make my decision on how to continue our project :) GL fixing the bug if any help/further details is needed let me know. |
Hi @nozzlegear! I'm using ShopifySharp 6.18 and .net standard 2.0 and facing the same issue. I've done some debugging, hopefully this is helpful: In ShopifyService.cs, the I think the reason why it gets disposed is here: https://stackoverflow.com/questions/25495394/why-do-httpclient-postasync-and-putasync-dispose-the-content. Let me know if there is any more detail you'd like me to share 😄 |
I went from 4.6 to 4.8 in a project and update the nuget package and started seeing this issue as well. |
Thanks for the report @judoscott. Just want to confirm quick, you upgraded your project to .NET 4.8, and you updated ShopifySharp at the same time? |
Yes thats correct. I am going to have a go at upgrading to .NET 8 and will report back the results. Its a rather large project though so might take a bit |
.Net 8 proved to much for this on short notice. Reverted to .net 4.6.1 and Shopifysharp 6.17 |
I'm fixing this right now, will have a new build within the next couple of days! |
Hi,
With my project I want to use the GraphAPI to fetch products, orders, etc.
ShopifySharp has a GraphService which would be able to fullfill this purpose (as far as my understanding goes).
I'm using ShopifySharp 6.17 and .net framework 4.8.
I have a test method to try out fetching products.
Yet when the graphservice does it's
SendAsync(request)
, I get an exception which states the following;Cannot access a disposed object. Object name: 'System.Net.Http.StringContent'.
Am I doing something wrong here? Is this a bug within the framework?
I am a bit lost. I appreciate the help.
this is the code example that I use. (mind you my graphql query could be garbage, since I am trying to understand how it works);
The text was updated successfully, but these errors were encountered: