Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC3 Area _ViewStart.cshtml not deployed

I am deploying an ASP.NET MVC3 project to a windows 2008 r2 server using Visual Studio 2010 Web Deployment tool.

Everything appears to work correctly when browsing my top level site but when I browse to views inside an Area in the website the Area's local layout style is missing.

Looking on the server I can see that the Area’s shared layout file has been deployed to the folder <site>/<area>/views/shared but the Area’s _ViewStart.cshtml is missing from folder <site>/<area>/views/. Presumably as this file specifies where my layout view is sourced that this is my problem.

So question is any ideas as to what I am doing wrong/missing in the deployment stage for this file to be ignored?

like image 906
MPD Avatar asked Apr 11 '12 14:04

MPD


1 Answers

Sometimes the "Build Action" of a file gets changed from "Content" to something else. When this happens, the deploy process either embeds (in the bin folder) the files or performs some other action (like ignoring).

To check/fix the issue:

  1. Right click the file
  2. Choose Properties
  3. In the properties window, ensure the Build Action is "Content"
like image 186
Nick Bork Avatar answered Oct 14 '22 07:10

Nick Bork