locked
Creating a Classifier Extension ? RRS feed

  • Question

  • I am trying to create a classifier extension, which is shown in the web link:

    https://docs.microsoft.com/en-us/visualstudio/extensibility/creating-an-extension-with-an-editor-item-template 

    The solution is built successfully without problems. but when I run it and try to open a new text file, the editing area of the new text file does not appear. 

    if I try to open a new C# class file, then it gives me the following error message: 

    Expexted 1 export(s) with contract name "Microsoft.VisualStudio.Text.Editor.ITextEditorFactoryService" but found 0 after applying applicable constraints. 

    and sometimes the following meesage is shown: 

    Roslynpackage did not load correctly. 


    • Moved by CoolDadTx Monday, December 4, 2017 3:03 PM Extensibility related
    Monday, December 4, 2017 7:04 AM

Answers

  • Hi,

    Based on your description and related link, I create a simple demo and open class file, which works fine.

    Please try to the following solution and check if it works.

    Close all Visual Studio instances, then delete all files in the following folder:

    VS 2013

    %localappdata%\Microsoft\VisualStudio\12.0\ComponentModelCache

    VS 2015

    %localappdata%\Microsoft\VisualStudio\14.0\ComponentModelCache
    VS 2017

    %localappdata%\Microsoft\VisualStudio\15.0_807e9d7b\ComponentModelCache

    Best regards,

    Zhanglong Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by hans.sweden Wednesday, December 6, 2017 11:17 AM
    Tuesday, December 5, 2017 5:31 AM

All replies

  • I am trying to create a classifier extension, which is shown in the web link:

    https://docs.microsoft.com/en-us/visualstudio/extensibility/creating-an-extension-with-an-editor-item-template 

    The solution is built successfully without problems. but when I run it and try to open a new text file, the editing area of the new text file does not appear. 

    if I try to open a new C# class file, then it gives me the following error message: 

    Expexted 1 export(s) with contract name "Microsoft.VisualStudio.Text.Editor.ITextEditorFactoryService" but found 0 after applying applicable constraints. 

    and sometimes the following meesage is shown: 

    Roslynpackage did not load correctly. 

    Monday, December 4, 2017 7:09 AM
  • People that try to help others really don't like it when someone posts the same question in more than one place at the same time.


    Sam Hobbs
    SimpleSamples.Info

    Monday, December 4, 2017 7:47 PM
  • People that try to help others really don't like it when someone posts the same question in more than one place at the same time.


    Sam Hobbs
    SimpleSamples.Info

    Monday, December 4, 2017 7:48 PM
  • Hi,

    Based on your description and related link, I create a simple demo and open class file, which works fine.

    Please try to the following solution and check if it works.

    Close all Visual Studio instances, then delete all files in the following folder:

    VS 2013

    %localappdata%\Microsoft\VisualStudio\12.0\ComponentModelCache

    VS 2015

    %localappdata%\Microsoft\VisualStudio\14.0\ComponentModelCache
    VS 2017

    %localappdata%\Microsoft\VisualStudio\15.0_807e9d7b\ComponentModelCache

    Best regards,

    Zhanglong Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by hans.sweden Wednesday, December 6, 2017 11:17 AM
    Tuesday, December 5, 2017 5:31 AM
  • I posted in two different forms because I did not know what is the best place to post it in. At all, thanks to your comment. 
    Wednesday, December 6, 2017 11:00 AM
  • Other people are having the same problem, see here.

    Often Visual Studio works properly at first, but after a number of debug sessions it decides not to work anymore, and for me it did not help to uninstall and reinstall VS, nor did it help to switch from VS 2017 to VS 2019.

    I think there must be a "bad" configuration setting somewhere that is not erased during uninstallation. Can someone at MS suggest how to rigorously delete all Visual Studio configuration from a machine? The "Reset all settings" thing inside "Import and Export Settings" is insufficient.


    • Edited by Qwertie Wednesday, March 11, 2020 12:45 AM
    Wednesday, March 11, 2020 12:45 AM