Is it safe to dispose HttpConfiguration?
The place that make sense to dispose httpConfiguration
in owin app, is in OnAppDisposing
HttpConfiguration httpConfiguration = new HttpConfiguration();
app.UseWebApi(httpConfiguration);
AppProperties properties = new AppProperties(app.Properties);
CancellationToken token = properties.OnAppDisposing;
if (token != CancellationToken.None)
{
token.Register(() =>
{
httpConfiguration.Dispose();
});
}