views:

22

answers:

1

I'd like to copy a file and include the file in the web project and would like to do this as a part of the Pre/Post build events.

My understanding is that these events support DOS commands and I can use xcopy for copying a file, but I am not sure how I would update the csproj file to include the file in the project.

A: 

Do you need the file to be in the output directory or actually be part of the .csproj file ?

If you really want to update the csproj file then try customising the AfterBuild target in the csproj file of the startup project in your solution. All csproj files are msbuild files and you can use the full power or msbuild including callling any task. Right click on the project in the solution explorer, select unload project and then edit project. Then customise the AfterBuild target to change the particular csproj file you want. Use built in tasks or the excellent extension pack for changing the file. Finally reload the project.

Pratik