In a previous post, .NET 11 Preview - MIME Type Lookups, we looked at the new MediaTypeMap class that allows us to fetch MIME Types from file extensions natively in .NET without requiring third-party libraries.

This has further been updated to support a lesser-used but very common format in technical circles - Computer Graphics Metafile, .cgm, standardized in ISO 8632-1.

This means that this code:

Console.WriteLine(MediaTypeMap.GetMediaType("cgm"));

Will print the following:

mediaTypeFromExtension

Correspondingly, we can get the extension from the name, like so:

Console.WriteLine(MediaTypeMap.GetExtension("image/cgm"));

This will print the following:

mediaTypeNameFromExtension

TLDR

Computer Graphics Metafile support has been added to the MediaTypeMap class.

Happy hacking!