0

我目前正在尝试为 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对象内的什么位置?

4

1 回答 1

0

我不熟悉 Visual Studio 对象模型,但在 VS2005 的文档中,以下对象具有 ExcludedFromBuild 属性:

VCFileConfiguration
VCFileConfigurationProperties
VCPreBuildEventTool
VCPreLinkEventTool
VCPostBuildEventTool
VCWebDeploymentTool

希望这将引导您走上正确的道路。

于 2010-06-25T19:53:54.207 回答