Package.SetSite引发System.NullReferenceException吗? [英] Package.SetSite throws System.NullReferenceException?

查看:62
本文介绍了Package.SetSite引发System.NullReferenceException吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我正在尝试使用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.com/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 http://pastebin.com/m32e0b9c9)

代码块

推荐答案



我有同样的问题,您找到了解决它的方法吗?

Francois
Hi,

I have the same  problem, have you found a way to fix it ?

Francois


这篇关于Package.SetSite引发System.NullReferenceException吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆