部分填充了项目对象? [英] Project object partially populated?
问题描述
问候,
我有一个VS加载项,我正在尝试获取Visual Studio中当前活动项目的Project对象.我正在使用以下代码进行操作:
Greetings,
I have a VS Add-In and I'm trying to get the Project object for the currently active project in Visual Studio. I'm doing this with the following code:
p =( 项目 ) 这 ._ applicationObject.Solution.Item(1);
我从中得到的结果很奇怪……我得到了一个对象,但是某些属性显示异常.即,FullName和FileName属性显示以下消息:p. propertyname'引发了类型为'System.NotImplementedException'的异常字符串{System.NotImplementedException}
这是什么原因引起的?如何解决?
谢谢,
SB
p = (Project)this._applicationObject.Solution.Item(1);
What I get from this is strange...I get an object, but some of the properties display exceptions. Namely, the FullName and FileName properties show the following message: p.propertyname 'threw an exception of type 'System.NotImplementedException' string {System.NotImplementedException}
What causes this? How to fix?
Thanks,
SB
推荐答案
尝试一下:
_applicationObject .ActiveWindow.Project 字体>
如果您仍然遇到问题,请在阅读以下文章后随意发布更多详细信息:
如何提出问题以增加答案的可能性
Try this:
_applicationObject.ActiveWindow.Project
If you still have problems, feel free to post more detailed information after you read the following post:
How to ask questions to increase your chances of an answer
这篇关于部分填充了项目对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!