IFileExtensionRegistryService.GetContentTypeForExtension Method

Gets the content type associated with the given file extension.

Namespace:  Microsoft.VisualStudio.Utilities
Assembly:  Microsoft.VisualStudio.CoreUtility (in Microsoft.VisualStudio.CoreUtility.dll)


Function GetContentTypeForExtension ( _
    extension As String _
) As IContentType
IContentType GetContentTypeForExtension(
    string extension
IContentType^ GetContentTypeForExtension(
    String^ extension
abstract GetContentTypeForExtension : 
        extension:string -> IContentType 
function GetContentTypeForExtension(
    extension : String
) : IContentType


  • extension
    Type: System.String
    The file extension. It cannot be nulla null reference (Nothing in Visual Basic), and it should not contain a period.

Return Value

Type: Microsoft.VisualStudio.Utilities.IContentType
The IContentType associated with this extension. If no association exists, it returns the "unknown" content type. It never returns null.

.NET Framework Security

See Also


IFileExtensionRegistryService Interface

Microsoft.VisualStudio.Utilities Namespace