Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load type 'Microsoft.AspNetCore.Http.Internal.BufferingHelper' from assembly 'Microsoft.AspNetCore.Http, Version=3.1.0.0

I am trying to upgrade my API project from .net core 2.2 to .net core 3.1. I get this exception while I try to make the API call.

"Message":"Could not load type 'Microsoft.AspNetCore.Http.Internal.BufferingHelper' from assembly 'Microsoft.AspNetCore.Http, Version=3.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.","Statuscode":500,"TrackingID":"800000bd-0000-fe00-b63f-84710c7967bb"

I tried the solution on "github"

Please help me fix the issue.

like image 548
Akshay Avatar asked Dec 24 '19 08:12

Akshay


1 Answers

I know you already tried this solution but I didn't understand what the post meant with (See comment below)

"By referencing the fixed dll instead of the NuGet package it works again."

However:

My Azure Function was using EnableRewind() on the request object in order to make the stream seekable. I did a straight replace with EnableBuffering() and everything worked again.

I'm using Azure Functions v3 with .NET Core 3.1. This was the error I originally received:

Could not load type 'Microsoft.AspNetCore.Http.Internal.BufferingHelper' from assembly 'Microsoft.AspNetCore.Http, Version=3.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
like image 50
Nick Pearce Avatar answered Sep 19 '22 21:09

Nick Pearce