IFileExtensionRegistryService.AddFileExtension Method (String, IContentType)

 

Adds a new file extension to the registry.

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

void AddFileExtension(
	string extension,
	IContentType contentType
)

Parameters

extension
Type: System.String

The file extension. The period is optional.

contentType
Type: Microsoft.VisualStudio.Utilities.IContentType

The content type for the file extension.

Exception Condition
InvalidOperationException

extension is already present in the registry.

This method throws InvalidOperationException if the specified file extension is already present in the registry.

Return to top
Show: