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
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"