从MSBuild调用VS自定义工具

3

我有一个.NET Micro Framework项目,其中包含一个*.resx嵌入式资源文件。

在VS中,自定义构建工具设置为ResXFileCodeGenerator(似乎是.NET Micro Framework特定版本,因为生成的代码 质量较低 并且存在 并发错误)。

当通过Visual Studio更改*.resx文件时,将运行此自定义构建工具。当从Visual Studio外部更改*.resx文件或构建项目时,不会运行该工具。选择*.resx文件并选择“运行自定义工具”时也会运行该工具。

这是一个问题,因为我想通过msbuild构建项目。在那种环境下,过时的*.Designer.cs文件不是什么好东西 ;-)

  • How can I invoke a custom tool like ResXFileCodeGenerator from msbuild?
  • If this is not possible: Where can I find documentation about how this ResXFileCodeGenerator works? How can I invoke it manually from command line?
  • How does the ResXFileCodeGenerator deduce the numeric identifiers that are generated in the Designer.cs file?

    [System.SerializableAttribute()]
    internal enum BinaryResources : short
    {
        SomeBinaryResource = -7023,
    }
    
1个回答

1
我认为所有针对.NETMF的构建工具都包含在NETMF源代码中。您可能希望查看.NETMF源代码中的构建任务。
这些工具位于client_(version)/Framework/Tools/中。
构建任务的配置位于client_(version)/tools/Targets中。

谢谢。构建任务非常有见地 :-) 请参阅GenerateResource.cs中的GenerateIdFromResourceName - Etan

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接