我目前正在尝试为 Visual Studio 2008 创建一个插件,该插件将列出当前构建配置中未排除的所有文件。
我目前有测试 C++ 控制台应用程序,它有 10 个文件,其中 2 个是“从构建中排除”的。这是一个允许从特定配置(即调试或发布)中排除特定文件的属性。当您在解决方案资源管理器中右键单击文件并选择“属性”->“配置属性”->“常规”->“从构建中排除”时,此属性位于
目前,我有以下代码将遍历所有项目文件并获取每个文件的属性。
foreach (Project theProject in _applicationObject.Solution.Projects)
{
getFiles(theProject.ProjectItems);
}
private void getFiles(ProjectItems theItems)
{
foreach (ProjectItem theItem in theItems)
{
string theItemName = theItem.Name;
foreach (Property theProp in theItem.Properties)
{
string thePropName = theProp.Name;
}
getFiles(theItem.ProjectItems);
}
}
我遇到的问题是我似乎找不到“从构建中排除”属性。我找不到关于哪些属性在哪里列出的很好的文档。这个 Excluded From Build 属性在_applicationObject
对象内的什么位置?