-
Notifications
You must be signed in to change notification settings - Fork 38
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
.NET 8 support and "Could not load file or assembly 'System.Net.Http.Formatting, Version=6.0.0.0" #529
Comments
Update on this issue. Just to be sure, I created a new solution with only a single Azure Functions .NET 8 project. I sent a standard SendGrid request from Postman to the function and the function picked up the POST request just fine. As soon as it ran: var inboundEmail = await parser.ParseInboundEmailWebhookAsync(request.Body); I got the same error.
I have seen other issues raised related to other problems by users running on Azure Functions V4 and .NET 8. So I am hoping that it is not a .NET 8 support issue. But if not, then I am quite stuck. Again, any assistance much appreciated. |
What you are describing is a well-known problem with "in-process" Azure functions. Allow me to emphasize "in-process", this is a rather important detail which is at the heart of this issue. You haven't stated whether you are using in-process or not but I'm going to assume that you are. I have explained the root of this problem before so I won't explain it again but simply summarize that you can make this problem go away by switching to "out-of-process" (AKA "isolated worker model") Azure functions. Speaking of in-process vs out-of-process: my understanding is that Microsoft is phasing out "in-process" and is encouraging their customers to switch to out-of-process, as announced here. |
Haven't heard back therefore I will assume my suggestion was helpful |
Hi, Very sorry to not reply. Totally slipped my mind. Your assistance was very much appreciated and certainly helped to explain the issue a lot! Sure enough it was exactly the cause of the issue and has now been resolved by moving to the isolated worker mode. Many thanks! |
You're welcome. Glad I could help! |
I'm not using StrongGrid but I found this thread while searching for the same issue. Thank you, @Jericho, for your help. If you don't want to go down the route of migrating to Isolated mode, the following change to the <ItemGroup>
<FunctionsPreservedDependencies Include="System.Net.Http.Formatting.dll" />
</ItemGroup> I found this workaround here: Azure/azure-functions-host#10575 |
@mdickin I'm glad this post was useful to you, that's what communities are for! And also, thanks for the alternate workaround. |
Hi all,
UPDATE: I tried rolling back to v0.108.0, and experienced the same issue. I then tried 0.107.0 of StrongGrid and the issue did not occur. Parsing of the post body worked perfectly. So I am not sure what was introduced in v0.108.0 but it appears to have broken something. END UPDATE.
I have an Azure Functions project targeting .NET 8. The function is a standard HTTP function which will be receiving SendGrid Inbound Parse webhooks.
I am using Version 0.109.0 of Strong Grid.
var parser = new WebhookParser(); var inboundEmail = await parser.ParseInboundEmailWebhookAsync(request.Body);
When I run the above, I get the following error
Executed 'dataServiceInboundEmail' (Failed, Id=439fab89-72dd-4add-b347-6d4bf97d025d, Duration=412ms) [2024-07-26T02:22:15.142Z] System.Private.CoreLib: Exception while executing function: dataServiceInboundEmail. StrongGrid: Could not load file or assembly 'System.Net.Http.Formatting, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
I am wondering if this is due to a lack of .NET 8 support by StrongGrid, or something else?
If its due to .NET 8 support, is there any ETA on supporting .NET 8 with StrongGrid?
If it is something else, is anyone able to suggest why I might be getting this error and how I can resolve it?
Any help with this would be greatly appreciated. I have tried including System.Net.Http.Formatting, Version=6.0.0.0 in the csproj, but get errors saying that package cannot be found. Not sure where I am going wrong.
Regards,
The text was updated successfully, but these errors were encountered: