views:

318

answers:

1

Today I've started adding Web Deployment projects for our web application, and noticed that the deployment project picks up everything that could be a content file from the web application, including the csproj files etc.

I've seen online how you can manually exclude files using the MSBuild task ExcludeFromBuild, and that is currently the way I'm looking to approach this.

My questions: Is there a way to restrict the files sent to the Web Deployment Project, to only those that are included in the Web Application Project?

+1  A: 

You probably could do this using an approach similar to MSBuild: How to get all generated outputs but with this you will be adding a bunch of un-needed coplexity to your build script. For this I would just say maintain that list. I would also suggest that after you exclude the files initially there should not be too many files that need to be excluded after that. If you find that at some point later there are a bunch you should find out why that is.

Sayed Ibrahim Hashimi