MattH
MattH

Reputation: 4227

Can I easily exclude files from my web deployment project, that are excluded from my web application project?

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?

Upvotes: 2

Views: 735

Answers (1)

Sayed Ibrahim Hashimi
Sayed Ibrahim Hashimi

Reputation: 44322

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

My Book: Inside the Microsoft Build Engine : Using MSBuild and Team Foundation Build

Upvotes: 2

Related Questions