I need the following information:
I need to create an MSBuild task that will create an xml file, which then I need to embed as a resource in one of the built projects. How do I change my MSBuild project for this? Is there a built-in task that I can use to embed a file, or do I need to create it? If the latter, any direction in this would be great.
Thanks in advance!
Update. Based on the above suggestions, I added an empty XML file to the project as a resource, creating a simple MSBuild task (http://bartdesmet.net/blogs/bart/archive/2008)./02/15/the-custom-msbuild-task -cookbook.aspx), which writes the contents to this file as needed and runs this task as the "BeforeBuild" target. It works like a charm. Please note that I had to “exclude the file from the source control”, so it will not be checked every time I create a project, and I also added code to the task to make sure the file is not read-only (http: / /www.del337ed.com/blog/index.php/2007/09/05/clearing-the-read-only-flag-on-a-file-in-c/).
source share