In a Blazor Server Side .net 7 app if you need to handle some particular static files types (eg. a outlook .msg or something that would be treated as application/octet-stream) you have to configure it in program.cs like this
builder.Services.PostConfigure<StaticFileOptions>(o =>
{
((FileExtensionContentTypeProvider)o.ContentTypeProvider).Mappings[".msg"] = "application/vnd.ms-outlook";
});
Unfortunately, this doesn’t work anymore in .NET 8, it is confirmed by design, but I cannot figure out how to fix…
Any help?
Thanks