views:

15

answers:

1

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?

A: 

See this post

Adam Driscoll