Ryan Bosinger
Ryan Bosinger

Reputation: 1862

Visual Studio 2012 - Copy "Views" and "Content" to project Output Path

I have an MVC project and would like to have the build output to a different directory. I have set the Output Path in the project properties and this takes care of where all the .DLL's are deployed but how do I have my Views and Content folders move there as well?

I realize I could use post-build events to move the files but I feel like there is an easier way (which I may have done before...).

Upvotes: 2

Views: 857

Answers (2)

Joey
Joey

Reputation: 1800

A bit late but I think you need to set 'WebProjectOutputDir' too. For my project I have:

WebProjectOutputDir=ReleaseFolder 

and

OutDir=ReleaseFolder\bin

Upvotes: 1

Ryan Bosinger
Ryan Bosinger

Reputation: 1862

I ended up going with Post-build events because it was easy enough...

Robocopy $(ProjectDir)Views $(TargetDir)..\Views /s
Robocopy $(ProjectDir)Content $(TargetDir)..\Content /s
Copy $(ProjectDir)Web.config $(TargetDir)..\Web.config

This will still use output path variable set within the Visual Studio project properties. This was important to me because some team members are quite junior and I would like the set-up process to be straight forward.

Upvotes: 2

Related Questions