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

前端 未结 4 1254
长发绾君心
长发绾君心 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条回答
  •  灰色年华
    2021-02-07 10:47

    I was unable to get the other workaround to work, but the following pre-build event seemed to work for me:

    rmdir /s /q "$(ProjectDir)obj\Debug\Package"
    rmdir /s /q "$(ProjectDir)obj\Debug\TransformWebConfig"
    rmdir /s /q "$(ProjectDir)obj\Release\Package"
    rmdir /s /q "$(ProjectDir)obj\Release\TransformWebConfig"
    

提交回复
热议问题