Visual Studio 2010 Web Publish missing a file

Ian Warburton picture Ian Warburton · Apr 26, 2011 · Viewed 11.3k times · Source

I'm finding that when publishing a website from Visual Studio its not uploading one of my files. Its a Razor file with a '.cshtml' extension (its doing the others!) and its part of the project.

Any ideas why it would exclude it?

Answer

Petrus Theron picture Petrus Theron · Apr 26, 2011

In Visual Studio, right-click on the file and go to Properties.

Under the file's properties, make sure that Build Action is set to Content. Otherwise it won't be published via web deploy.