Cymen Vig

Software Craftsman

Mime types for ASP.NET

One of the annoyances working on the Windows/IIS stack is that getting mime types is a pain. They are located in multiple places and there is no really ideal “best practice” method to get mime types without what I consider overly-complicated solutions. In light of this observation I wrote a basic C# program that fetches the mime.types file from the Apache project and converts it to a C# Dictionary<string, string> keyed by file extension. It is a basic program but might be useful for others wondering why in the world this is so complicated.

ApacheMimeTypesToDotNet on github

The output looks like this: ApacheMimeTypes.cs