简体   繁体   English

切换所有.cshtml文件的“复制到输出:始终”

[英]Toggle to switch “copy to output: always” for all .cshtml files

I've got a fubu mvc application that only works on local iis if my view files (.cshtml) are copy to output and set as resources (via the properties menu). 我有一个fubu mvc应用程序,如果将我的视图文件(.cshtml)复制到输出并设置为资源(通过属性菜单),该应用程序只能在本地iis上运行。

However, for them to be picked up on windows azure they need to be set as "copy to output: always" but not set as resources. 但是,要在天蓝色的Windows上拾取它们,需要将它们设置为“复制到输出:始终”,而不是设置为资源。

Is it possible to change this setting in code or powershell? 是否可以在代码或Powershell中更改此设置? So I can flip a switch before pushing to azure, then flip it back after? 因此,我可以在推至天蓝色之前先拨动开关,然后再拨回去?

I'm late to the party but the answer to your question is that .cshtml-files must be set as Build Action : Content under Properties. 我来晚了,但是您问题的答案是.cshtml文件必须设置为Build Action :Properties下的Content This is the default build action for MVC-views. 这是MVC视图的默认构建操作。

Copy to output directory should be set to Do not copy 复制到输出目录应设置为不复制

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM