简体   繁体   English

如何知道Visual Studio项目项是否是WebReference?

[英]How to know if a Visual Studio project item is a WebReference?

I'm developing a Visual Studio extensibility package. 我正在开发一个Visual Studio可扩展性包。 I need to get the files under a project hierarchy using IVsSccProject2.GetSccFiles . 我需要使用IVsSccProject2.GetSccFiles在项目层次结构下获取文件。

Visual Studio behaves different for an standard folders and for WebReferences: Visual Studio对于标准文件夹和WebReferences的行为不同:

  • An standard folder returns no SCC files even it has childs. 标准文件夹即使有子节点也不返回SCC文件。
  • The WebReference returns all the files under the web reference (*.wsdl, *.datasource, *.map, *.cs) WebReference返回Web引用下的所有文件(* .wsdl,* .datasource,* .map,* .cs)

This causes a problem because I use a common function to enumerate files under a project item. 这会导致问题,因为我使用通用函数枚举项目项下的文件。

How can I determine if the project item is a web reference or a standard folder? 如何确定项目项是Web引用还是标准文件夹?

I tried to get the item type using: 我尝试使用以下方式获取项目类型:

hierProject.GetGuidProperty(
    itemid,
    (int)__VSHPROPID.VSHPROPID_TypeGuid,
    out guid);

but in this case the returned GUID is always Physical Folder ( 6BB5F8EF-4483-11D3-8BCF-00C04F8EC28C ) for both WebReference and standard folder. 但在这种情况下, 返回的GUID始终是WebReference和标准文件夹的物理文件夹( 6BB5F8EF-4483-11D3-8BCF-00C04F8EC28C )。

根据上面的注释,使用GetSccSpecialFiles方法。

暂无
暂无

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

相关问题 Visual Studio扩展-如何在解决方案\\项目项选择更改上进行监听 - Visual Studio Extension - How to listen on Solution \ Project item selection change MS Visual Studio - 如何从文件系统导入项目或解决方案并知道它是什么类型的项目 - MS Visual Studio - how to import a project or solution from file system and know what kind of project it is Visual Studio项目模板:用项目名称替换 - Visual Studio item template: Replace with project name Visual Studio如何知道Project是VB项目或如何将项目转换为C#项目 - How does Visual Studio know Project is a VB project or How can I convert my project to C# project Visual Studio中共享项目的项目模板 - Item template for shared project in Visual Studio 您如何知道Visual Studio中的哪个项目最后构建? - How do you know which project in Visual Studio builds very last? 如何以编程方式在Visual Studio项目中生成新的Visual Studio项目? - How to Generate a New Visual Studio Project in a Visual Studio Project Programmatically? 如何将Visual Studio 2013项目降级为Visual Studio 2008项目? - How to downgrade a Visual Studio 2013 project to a Visual Studio 2008 project? 如何在Visual Studio 2010中将新项添加到项目上下文菜单? - How to add new items to the Add New Item to project context menu in visual studio 2010? 如何获取 WSDL/描述以便可以在另一个项目中添加 WebReference? - How do I get the WSDL/description so that I can add WebReference in another project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM