MSBuild: How do I create and use a Task to convert Content items at build time?

前端 未结 3 1793
再見小時候
再見小時候 2020-12-29 14:38

I have a Silverlight 3 project with something like this:


  
  
         


        
3条回答
  •  渐次进展
    2020-12-29 15:24

    Instead of creating a MSBuild task you can also create a Custom tool and specify this in Custom Tool in properties of your image file.

    "a custom tool will transform a file at design time and will place the output of the transformation into another file"

    e.g. DataSet. it has its own transformation tool through which we get a class to use in our application.

    the advantage of this approach is you can use the generated file at design time as well.

    as sample implementation can be found at http://www.drewnoakes.com/snippets/WritingACustomCodeGeneratorToolForVisualStudio/

提交回复
热议问题