Search code examples
c#visual-studiovisual-studio-extensions

In VS Extension project, Opening a file, I get this error [Duplicate EditorFormatDefinition exports with identical name attributes exist]


In Visual Studio extension project, Opening a file,i got the below popup. enter image description here

Navigate to the particular location i get the error information as

System.ComponentModel.Composition.ImportCardinalityMismatchException: Duplicate EditorFormatDefinition exports with identical name attributes exist. Duplicate name is keyword at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)

How to resolve this issue?. Thanks in Advance


Solution

  • Duplicate EditorFormatDefinition exports with identical name attributes exist.

    This could be similar to this issue. Normally the error message Duplicate EditorFormatDefinition exports with identical name attributes exist indicates you have conflicting extensions installed in your VS. More similar posts see here(one and two).

    You can try steps below to resolve it:

    1.Go Tools=>Extensions and Updates to disable or uninstall all the third-party extensions there, and then close VS to make changes take effect. (Uninstalling them could be better to clean the environment)

    2.Clean VS components cache and restart VS to check if the issue is resolved by creating a new VSIX project

    If #1, #2 helps to resolve this issue, we can make sure it results from third-party extensions. Install the third-party extensions back one-by-one may help locate which extension causes this.

    3.If the issue persists, maybe there's something broken with VS IDE. Update VS to latest version or run a VS repair to check if it makes any difference.

    In addition: It's recommended that we update the VS2017 to latest 15.9.17, and update those extensions as well. This will make some help to avoid meeting this kind of issue.