简体   繁体   English

EnvDTE-如何通过FileNames属性从ProjectItem获取文件路径

[英]EnvDTE - How to get a file path from a ProjectItem via the FileNames property

I'm working on a DTE Wrapper library. 我正在开发DTE包装器库。 For full typed access on a Visual Studio solution over DTE. 用于通过DTE在Visual Studio解决方案上进行全类型访问。 All works okay But now the problem: 一切正常,但现在出现了问题:

I use the method "AddFromFile" on solution folder. 我在解决方案文件夹中使用方法“ AddFromFile”。

After add a sulution folder item from a folder, and then add a solution folder item with same file name, but different folder , the created projectItem.FileNames[1] points to the wrong item! 从文件夹中添加Sulution文件夹项目,然后添加名称相同但文件夹不同的解决方案文件夹项目后,创建的projectItem.FileNames [1]指向错误的项目! I cannot get the real full path to this item. 我无法获得此商品的真实完整路径。

Thx for your help! 谢谢您的帮助! Marko 马可

Okay, i now seen, the initialization at this special solutions works from my wrapper, so this is a problem during add a new item. 好的,我现在看到了,这种特殊解决方案的初始化可以通过我的包装器进行,所以这是添加新项目时的问题。

So, i can handle this strange behavoir through a manual set the full name... 因此,我可以通过手动设置全名来处理这种奇怪的行为。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM