Request.RawData not recorded in ASP.NET Core 3.1 (using Mindscape.Raygun4Net.AspNetCore 6.2.0)
lancesh
Posted on
May 20 2020
In a vanilla ASP.NET Core 3.1 web application Raygun does not appear to be recording Request.RawData.
Steps to recreate:
- Create new, blank ASP.NET Core Web Application in Visual Studio (2019)
- Follow setup instructions from https://raygun.com/documentation/language-guides/dotnet/crash-reporting/aspnetcore/
- Create a controller action with [HttpPost] attribute which throws an exception
- Run the app (IIS Express)
- Call above controller action with a JSON body.
Expected Outcome
Error is logged in Raygun, RawData is populated with the JSON from step 4.
Actual Outcome
Error is logged in Raygun, RawData is not populated.
Notes
It doesn't appear to make a difference if AddMvc, or AddControllers / endpoint routing is used.
Deleted User
Raygun
Posted on
May 22 2020
Hi Lancesh,
Thank you for getting in touch. The reason why you do not see the request raw data included in crash reports is due to the request streams being unseekable. To include the raw data in your reports, you can set the ReplaceUnseekableRequestStreams setting to true in your appsettings.json. This will attempt to replace any unseekable streams with a seekable copy on the request object so that Raygun can later read the raw request payload.
"RaygunSettings": {
"ApiKey": "YOUR_APP_API_KEY",
"ReplaceUnseekableRequestStreams": true
}
You can review other additional settings from the readme file located in our public repository here
We will look to review our documentation and ensure we include this information to avoid further confusion in the future.
Let me know if you have any more questions.
Thank you,
Mitchell
lancesh
Posted on
May 24 2020
Thanks Mitchell - I can confirm that this setting has resolved the issue.
Deleted User
Raygun
Posted on
May 25 2020
Awesome! Let us know if you have anymore more questions.
Regards,
Mitchell.