IVsEditorAdaptersFactoryService.CreateVsTextViewAdapter throws an object null reference

Posted by Adam Driscoll on Stack Overflow See other posts from Stack Overflow or by Adam Driscoll
Published on 2010-04-13T01:36:10Z Indexed on 2010/04/13 1:43 UTC
Read the original article Hit count: 344

I'm trying to create a IVsTextViewAdpater with the IVsEditorAdaptersFactoryService but when I call CreateVsTextViewAdapter it throws an object null reference:

    var editorFactory = componentModel.GetService<IVsEditorAdaptersFactoryService>();
    var serviceProvider = (Microsoft.VisualStudio.OLE.Interop.IServiceProvider)this;
    var view = editorFactory.CreateVsTextViewAdapter(serviceProvider);

'this' is a Microsoft.VisualStudio.Shell.Package implementation.

Any ideas?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about visual-studio-2010