Package.SetSite引发System.NullReferenceException吗?

编程入门 行业动态 更新时间:2024-10-25 22:34:57
本文介绍了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/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吗?

本文发布于:2023-11-17 03:21:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1608635.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:SetSite   Package   NullReferenceException   System

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!