I use a hosted build agent via Visual Studio Team Services (previously Visual Studio Online) for ALM to carry out my build definition, which takes my 'beta' branch from GitHub and deploys it to my 'beta' deployment slot on an Azure WebApp. Every goes fine, except for one file - a simple .cshtml file called snapshot.cshtml. It uploads the accompanying snapshot.js file, but the snapshot.cshtml file is nowhere to be found in the build logs.
This means despite a successful build my testers hit this:
The view '~/App/tenant/views/webitems/snapshot.cshtml' or its master was not found or no view engine supports the searched locations. The following locations were searched: ~/App/tenant/views/webitems/snapshot.cshtml
I go in via FTP and discover that the message is indeed accurate:
Workaround would be to upload the missing file, but obviously not ideal in a continuous deployment scenario.
Closer inspection of the .csproj file reveals an interesting difference:
I didn't do this. Looking back at Blame in GitHub (still getting to grips with GitHub) I can see it just set it like that when the file was first created:
It added snapshot.js fine as I wanted, but decided to set the Build Action for snapshot.cshtml to None for some unknown reason.
So whilst I hope others might find this post helpful, the question ultimately becomes how/why does it do that in the first place and how can I stop it from doing it again?