allowDefinition=’MachineToApplication’ error when publishing from VS2010 (but only after a previous build)

i had the same problem with my MVC apps. it was frustrating because i still wanted my views to be checked, so i didn’t want to turn off MvcBuildViews

luckily i came across a post which gave me the answer. keep the MvcBuildViews as true, then you can add the following line underneath in your project file:

<BaseIntermediateOutputPath>[SomeKnownLocationIHaveAccessTo]</BaseIntermediateOutputPath>

And make that folder not in your project’s folder. Works for me. It’s not a perfect solution, but it’s good for the moment. Make sure you remove the package folder (located inside the obj\Debug and/or obj\Release folder) from your project folder otherwise you’ll keep getting the error.

FWIW, MS know about this error

Leave a Comment