When the daily build ran today morning and after the deployment was successfully completed, I tried testing some code that I had checked in. I got a file not found error for one of the cshtml file that wwas recently added.
We use a Web Deployment Project, so after the daily build the web content gets pushed into the Web server.. Use (Team Build + Web deployment + Web deploy + VS 2010 framework for this.. I used Vishal Joshi’s steps to set it up.. http://vishaljoshi.blogspot.sg/2010/11/team-build-web-deployment-web-deploy-vs.html)
Meanwhile, coming back to the problem, I checked everything.. found that it was present in the TFS, local folder, created another mapped folder and executed “Get Latest version” Command, and found that it was part of the list of files. All other files were getting properly deployed. The problem was with one cshtml file and couple of scripts. All of which were recently introduced.
Then why wasn’t it getting pushed??? After a lot of brain racking and investigation I found the solution:
For some reason the Build Action property of these files were getting set as “None”. After I changed them back to “Content”, they started flowing smoothly into the web server after the build.
How to change?
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.