I am running aspnet_compiler as a post-build event, using the following command:
aspnet_compiler.exe -v / -p \
I am getting this error on compile:
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.
I have read several other StackOverflows about this, and tried the following:
- Looked for stray web.config files -- there are none, except the two that come standard in an MVC app (in the main MVC directory and in the Views directory).
- Added the application in IIS. This didn't make a difference.
- Tried running with IIS Express instead of the development server -- no difference.
Any thoughts on what could be causing this?
I think this is actually a Visual Studio bug. When I've seen this error I usually:
- Close Visual Studio.
- Delete the bin and obj folders of the project.
- Delete any other folder that might have a stray web.config (e.g. a backup sub-folder inside the project.)
- Launch Visual Studio.
- Open the solution and compile it again.
精彩评论