You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When pairing StackExchange.Exceptional.AspNetCore 2.0.0-rc2.* with Microsoft.AspNetCore.Mvc.Versioning 2.2.0 and configuring versioning to ReportApiVersions will throw System.InvalidOperationException: Headers are read-only, response has already started when attempting, and failing, to access the the exceptional page / task.
public class Startup
{
// ... other unimportant configuration
public IServiceProvider ConfigureServices(IServiceCollection services)
{
// ... other service configuration
services.AddExceptional(configuration.GetSection("Exceptional"));
// ... configure MVC
services.AddApiVersioning(options =>
{
options.AssumeDefaultVersionWhenUnspecified = true;
options.ReportApiVersions = true; // when set to true reporting api versions conflicts with StackExchange.Exceptional
options.DefaultApiVersion = new ApiVersion(1, 0);
options.ApiVersionReader = new HeaderApiVersionReader("api-version");
});
// ... other service configuration
}
}
setting ReportApiVersions to true will
... When this property is set to true, the HTTP headers "api-supported-versions" and "api-deprecated-versions" will be added to all valid service routes...
e.g. response header are modified, and Exceptional begins to fail
The text was updated successfully, but these errors were encountered:
When pairing
StackExchange.Exceptional.AspNetCore 2.0.0-rc2.*
withMicrosoft.AspNetCore.Mvc.Versioning 2.2.0
and configuring versioning to ReportApiVersions will throw System.InvalidOperationException: Headers are read-only, response has already started when attempting, and failing, to access the the exceptional page / task.I'm not sure if this is directly an issue with Exceptional, or with how Microsoft.AspNetCore.Mvc.Versioning is handling headers.
here is my configuration:
setting
ReportApiVersions
totrue
wille.g. response header are modified, and Exceptional begins to fail
The text was updated successfully, but these errors were encountered: