Open vikassharma5981 opened 3 years ago
Can I have some help here, I am struggling to fix this issue?
@Rick-Anderson Who could help with this / should we transfer it to the ASP.NET Core repo?
Create the simplest possible project on a public GitHub repository that reproduces the issue. After that we can transfer the issue to https://github.com/dotnet/aspnetcore/issues
We recently migrated from 2.2 to 5.0, everything works as expected but lately, we have started to face a problem with the APIs. We get a 200 OK with no response body. Referred the documents here for getting a resolution https://docs.microsoft.com/en-us/aspnet/core/migration/22-to-30?view=aspnetcore-5.0&tabs=visual-studio#break
StartUp.cs
Configure method
Points to note, we are not using
This is the controller:
This is the trace that we have: _System.ObjectDisposedException: Cannot access a disposed object. Object name: 'FileBufferingReadStream'. at Microsoft.AspNetCore.WebUtilities.FileBufferingReadStream.ThrowIfDisposed() at Microsoft.AspNetCore.WebUtilities.FileBufferingReadStream.Read(SpangBind|0>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g Awaited|250(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
1 buffer) at Microsoft.AspNetCore.WebUtilities.FileBufferingReadStream.Read(Byte[] buffer, Int32 offset, Int32 count) at Microsoft.AspNetCore.WebUtilities.HttpRequestStreamReader.ReadIntoBuffer() at Microsoft.AspNetCore.WebUtilities.HttpRequestStreamReader.Read(Span
1 buffer) at Microsoft.AspNetCore.WebUtilities.HttpRequestStreamReader.Read(Char[] buffer, Int32 index, Int32 count) at Newtonsoft.Json.JsonTextReader.ReadData(Boolean append, Int32 charsRequired) at Newtonsoft.Json.JsonTextReader.ReadChars(Int32 relativePosition, Boolean append) at Newtonsoft.Json.JsonTextReader.MatchValue(String value) at Newtonsoft.Json.JsonTextReader.MatchValueWithTrailingSeparator(String value) at Newtonsoft.Json.JsonTextReader.ParseFalse() at Newtonsoft.Json.JsonTextReader.ParseValue() at Newtonsoft.Json.JsonReader.Skip() at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.HandleError(JsonReader reader, Boolean readPastError, Int32 initialDepth) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Formatters.NewtonsoftJsonInputFormatter.ReadRequestBodyAsync(InputFormatterContext context, Encoding encoding) at Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BodyModelBinder.BindModelAsync(ModelBindingContext bindingContext) at Microsoft.AspNetCore.Mvc.ModelBinding.ParameterBinder.BindModelAsync(ActionContext actionContext, IModelBinder modelBinder, IValueProvider valueProvider, ParameterDescriptor parameter, ModelMetadata metadata, Object value, Object container) at Microsoft.AspNetCore.Mvc.Controllers.ControllerBinderDelegateProvider.<>cDisplayClass0_0.<Any assistance would be highly appreciated.