Visual Studio 2015 web deploy always deletes a spe

2019-09-10 05:12发布

问题:

In my Visual Studio 2015 MVC 5 web application, I'm deploying to Azure using publishing profile. In the publishing wizard, under settings, I have selected the Release build configuration and checked the "Remove additional files at destination" under File Publishing options.

When I'm done the publishing or even in preview mode it always deleting a view from the destination, instead of updating. It was never being published to the destination via the wizard, so I have FTP the cshtml file using FileZilla.



I have tried re-creating the publishing profile, but it works same as before. How do I include this file to be published as other files does?

回答1:

I have found the issue. In that specific file I looked for properties windows for any uncommon setting with same file types, and I found that Build Action setting was set to None while other files have set to Content. After that the file getting deleting issue solved.