Publishing of a MVC project from VS 2013/2012 fails just after adding to the web.config
<authentication ... />
or
<caching>
etc (section registered as allowDefinition='MachineToApplication').
Patient:
AspNetCompiler (aspnet_compiler.exe)
Error:
...\myProject\obj\Debug\AspnetCompileMerge\Source\bin\web.config(81,0): Error ASPCONFIG: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
The command exited with code 1.
Done building project "myProject.csproj" -- FAILED.
Reason:
(Visual Studio 2013, 2012)
The bin folder of the ASP.NET MVC site/project contains the same web.config as the root site folder!
(This folder is created constantly by ASP.NET MVC project/publish)
site_root\web.config
site_root\bin\web.config
Question
What to do with the AspNetCompiler (aspnet_compiler.exe) and this bin\web.config? It always there.
I want to publish from my VS ))
Solution Delete Files="$(SolutionDir)\$(ProjectDir)\bin***.*" was useless.