Make sure all *.cshtml files are set to be “Content” for Build Action

后端 未结 4 1651
谎友^
谎友^ 2021-02-01 15:28

A few times when I copy-paste *.cshtml files, Visual Studio for some reason sets Build Action on these files to be \"None\":

4条回答
  •  佛祖请我去吃肉
    2021-02-01 15:30

    I suggest to implement a custom build task. Call it on prebuild in your msbuild/tfs script. Custom build task should just check .scproj file if there is an include file of cshtml with build action none. Of so just exit returning a non zero int value.

提交回复
热议问题