Visual Studio 2010 Web Publish missing a file

陌路散爱 提交于 2019-11-29 02:10:22

问题


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?


回答1:


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.




回答2:


In my case I had a couple of config files that weren't being deployed even though they had "Build Action" set to Content. I fixed the problem by excluding them from the project and include them again




回答3:


I had the same issue. I tried to Exclude and re-Include the files. When that didn't work I checked my .proj file and the files were in fact missing. I had to add the files into the .proj file manually. That worked for me



来源:https://stackoverflow.com/questions/5789647/visual-studio-2010-web-publish-missing-a-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!