开发者

IVsEditorAdaptersFactoryService.CreateVsTextViewAdapter throws an object null reference

开发者 https://www.devze.com 2022-12-26 20:08 出处:网络
I\'m trying to create a IVsTextViewAdpater with the IVsEditorAdaptersFactoryService but when I call CreateVsTextViewAdapter it throws an object null reference:

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

开发者_如何学C
    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?


See this post

0

精彩评论

暂无评论...
验证码 换一张
取 消