title: Conditionally embed ASP.NET MVC2 Views as resources during build in Visual Studio 2010
body: <p>I have a ASP.NET MVC2 project in VS2010 that can be deployed in two modes: standalone or plugin.  In standalone mode, the views should live outside the compiled assembly as .aspx files (the default setup).  In plugin mode, the views are switched (currently by hand) to embedded resources and the entire assembly is dropped into a host project folder.</p>
  
  <p>Currently, this requires the developer to go through each view and switch it from Build Action: "Content" to "Embedded Resource" and vice versa.  I would like to create a new solution configuration to automatically grab all .aspx files and build them as resources.</p>
  
  <p>This <a href="https://stackoverflow.com/questions/2375565/conditionally-embedding-a-resource-in-visual-studio-c">SO post</a> seems like the solution, but I would prefer not to have to edit the .csproj every single time I add a new view to the project.  <strong>Is there a way to use a wild cards or some other batch/global conditionally statement to change resources from content to embedded?</strong></p>