VSIX extension for VS2012 not running when debugging

后端 未结 3 2177
伪装坚强ぢ
伪装坚强ぢ 2021-02-14 10:50

I created a new VSIX extension project in Visual Studio 2012, and wrote a MEF classifier (as a test) that should simply highlight all text in a .mylang file. Here a

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-14 11:41

    Edit: The problem is you've improperly exported your ContentTypeDefinition as a ClassificationTypeDefinition. You should use the following instead:

    [Export] // <-- don't specify the type here
    [Name(ContentType)]
    [BaseDefinition("code")]
    internal static ContentTypeDefinition MyLangSyntaxContentTypeDefinition = null;
    

    Here's my two guesses right now:

    1. Try removing the following line from your vsixmanifest. I assume you do not have a class in your project that extends Package, in which case Visual Studio might be refusing to load your package due to the following Asset line (your extension does not actually provide this asset).

      
      
    2. If that fails, try replacing your current source.extension.vsixmanifest with one written to the old schema (version 1.0). I know this form still works in Visual Studio 2012 because all ~20 extensions I work on (with >10 public releases) use the old schema.

提交回复
热议问题