开发者

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

开发者 https://www.devze.com 2023-03-29 16:32 出处:网络
I\'m developing a Visual Studio extensibility package. I need to get the files under a project hierarchy using IVsSccProject2.Get开发者_高级运维SccFiles.

I'm developing a Visual Studio extensibility package. I need to get the files under a project hierarchy using IVsSccProject2.Get开发者_高级运维SccFiles.

Visual Studio behaves different for an standard folders and for WebReferences:

  • An standard folder returns no SCC files even it has childs.
  • The WebReference returns all the files under the web reference (*.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?

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.


As per the comments above, use the GetSccSpecialFiles method.

0

精彩评论

暂无评论...
验证码 换一张
取 消