您好, 我正在尝试使用Visual Studio SDK将PHP(语言服务)集成到Visual Studio 2008中. 当我不调用Package.SetSite时(在我的情况下,在我的PHPLanguagePackage类中),Scanner(用于语法突出显示)可以正常工作.但是,从不会调用Package.ParseSource方法(从IronPython示例中,它看起来像是SetSite所必需的).但是当我调用Package.SetSite时,它会引发NullReferenceException(类型为' System.NullReferenceException"发生在Microsoft.VisualStudio.Package.LanguageService.dll中.我无法找到为什么它在IronPython示例中可以正常工作,但是在我的实现中引发了异常.我的程序包代码(我剥离了IOleComponent成员以提高可读性): (完整代码位于 http: //pastebin/m32e0b9c9 )
Hello,I'm trying to integrate PHP (language service) into Visual Studio 2008 using the Visual Studio SDK.When I don't call Package.SetSite (in my case, in my PHPLanguagePackage class), the Scanner (for syntax highlighting) works fine. However, the Package.ParseSource method is never called (and from the IronPython sample it looks like SetSite is required for that).But when I do call Package.SetSite, it throws a NullReferenceException (A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.VisualStudio.Package.LanguageService.dll).I can't find out why it works fine in the IronPython sample, but throws an exception in my implementation.My package code (I stripped the IOleComponent members for readability):(full code at pastebin/m32e0b9c9)
代码块 推荐答案我有同样的问题,您找到了解决它的方法吗? Francois Hi,I have the same problem, have you found a way to fix it ?Francois
更多推荐
Package.SetSite引发System.NullReferenceException吗?
发布评论