【问题标题】:Visual Studio Addin "Exclude From Build" PropertyVisual Studio 插件“从构建中排除”属性
【发布时间】:2010-06-25 18:08:22
【问题描述】:

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

【问题讨论】:

    标签: c# c++ visual-studio-2008 visual-studio-addins


    【解决方案1】:

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

    VCFileConfiguration
    VCFileConfigurationProperties
    VCPreBuildEventTool
    VCPreLinkEventTool
    VCPostBuildEventTool
    VCWebDeploymentTool

    希望这会引导你走上正确的道路。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-08-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-18
      • 2016-04-06
      相关资源
      最近更新 更多