代码之家  ›  专栏  ›  技术社区  ›  SoronelHaetir

Visual studio和自定义msbuild任务

  •  0
  • SoronelHaetir  · 技术社区  · 7 年前

    我正在编写一个定制的反编译任务,调用现有的源生成工具重新格式化错误输出,使之与VisualStudio的文件名和行号期望相匹配。如果我从命令行或VS本身构建项目,我的自定义任务就会运行,如果是从VS内部构建,那么生成窗口的输出就是我想要的。

    但是,Visual Studio项目资源管理器实际上并不显示输入文件。我已经添加了AuthableItNeN名字和ProjyType AgEngas项目,我还将文件扩展名添加到工具-GT选项、“项目和解决方案”-&“VC++项目设置”、“扩展包括”,甚至尝试更改我的测试项目中“源文件”组的扩展列表。我还缺什么?

    这是我的.Objor文件(我添加了.U..PROPS)(在发现XML有问题之后更新,但是修复并没有解决解决方案资源管理器问题)

    <?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>
    
    1 回复  |  直到 7 年前
        1
  •  0
  •   SoronelHaetir    7 年前

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