Why do I randomly get a “error to use section registered as allowDefinition='MachineToApplication'” when building an MVC project?

前端 未结 4 1308
长发绾君心
长发绾君心 2021-02-07 09:49

I have seen a few questions on SO about a similar error when deploying a website, but I seem to randomly get this error when building an ASP.NET MVC website in

4条回答
  •  Happy的楠姐
    2021-02-07 10:29

    I answered a similar question recently, and this looks like it might be related.

    To summarize, I ran into this in one of our MVC projects, and it was due to having the MvcBuildViews property in the project file set to true. Setting the property to false fixed the problem.

    false
    

    I also found this answer which outlines an alternative that does not require turning off view building.

提交回复
热议问题