Visual studio Visual studio和自定义msbuild任务

Visual studio Visual studio和自定义msbuild任务,visual-studio,msbuild,visual-studio-2017,Visual Studio,Msbuild,Visual Studio 2017,我正在处理一个自定义MSBuild任务,用于调用现有的源代码生成工具来重新格式化错误输出,使其符合Visual Studio的文件名和行号预期。我已经做到了这一点,如果我构建项目(无论是从命令行还是在VS本身中),我的自定义任务将运行,并且在从VS中构建的情况下,构建窗口输出是我所希望的 但是,VisualStudioProjectExplorer实际上并不显示输入文件。我已经添加了AvailableItemName和PropertyPageSchema项,我还将文件扩展名添加到工具->选项,“

我正在处理一个自定义MSBuild任务,用于调用现有的源代码生成工具来重新格式化错误输出,使其符合Visual Studio的文件名和行号预期。我已经做到了这一点,如果我构建项目(无论是从命令行还是在VS本身中),我的自定义任务将运行,并且在从VS中构建的情况下,构建窗口输出是我所希望的

但是,VisualStudioProjectExplorer实际上并不显示输入文件。我已经添加了AvailableItemName和PropertyPageSchema项,我还将文件扩展名添加到工具->选项,“项目和解决方案”->“VC++项目设置”,“要包含的扩展名”,甚至尝试更改测试项目中“源文件”组的扩展名列表。我还缺什么

这是我的.targets文件(我添加了一个.user.props(在意识到XML有问题后进行了更新,但修复了它并没有解决解决解决方案资源管理器问题)


好的,我能够找出问题所在,这是我在编辑中修复的XML问题的组合,然后需要重新启动VS,而不仅仅是重新加载我的测试项目。重新启动后(对于不相关的内容),我的文件现在显示在解决方案资源管理器中,并正确地参与依赖项解析(在解决UI问题后,如果我仍然有问题,我会问这个问题)

<?xml version="1.0" encoding="utf-8"?>
<ProjectSchemaDefinitions
    xmlns="http://schemas.microsoft.com/build/2009/properties"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:sys="clr-namespace:System;assembly=mscorlib">

    <ItemType
    Name="ToolName"
    DisplayName="Tool" />

    <ContentType Name="ToolName" DisplayName="Tool Name" ItemType="ToolName">
    </ContentType>
    <FileExtension Name=".<ext>" ContentType="ToolName">
    </FileExtension>

    <Rule Name="ToolName" PageTemplate="tool" DisplayName="Tool" Order="5">
        <Rule.Categories>
            <Category Name="General" DisplayName="General" />
        </Rule.Categories>
        <Rule.DataSource>
            <DataSource Persistence="ProjectFile" ItemType="ToolName" Label="" HasConfigurationCondition="true" />
        </Rule.DataSource>
        <StringProperty Name="OutputFile" DisplayName="Output File" Description="Names the produced output file" Category="General"/>
        <StringProperty Name="HeaderFile" DisplayName="Header File" Description="Names the produced header file" Category="General"/>
        <StringProperty Name="ReportFile" DisplayName="Report File" Description="Names the produced report file" Category="General"/>
    </Rule>
</ProjectSchemaDefinitions>