allowDefinition的='MachineToApplication'的错误时,从VS2010(但previous构建后只)发布 [英] allowDefinition='MachineToApplication' error when publishing from VS2010 (but only after a previous build)
问题描述
我可以在我的本地计算机上运行没有问题我Asp.Net MVC 2应用程序。只要运行/调试。
但是,如果我已经建立了它,我不能发布呢!我要清理解决方案,并重新发布。我知道这是不是系统的关键,但它真的很烦人。 一键发布不清洁解决方案,然后一键发布
确切的错误是:
错误11它是使用一个错误
部分注册为
allowDefinition的='MachineToApplication'
超越应用水平。此错误
可以通过虚拟目录引起
没有被配置为应用程序
在IIS。
块引用><击>我怀疑它的东西做在Views文件夹中的Web.Config,但为什么只有后,我一次构建previously。而只是为了说明,应用程序工作正常,一旦公布。击>
解决方案我有同样的问题,我的MVC应用程序。这是令人沮丧的,因为我还是想检查我的看法,所以我并不想关闭的 MvcBuildViews
幸运的是我遇到了一个<一个href=\"http://blogs.msdn.com/webdevtools/archive/2010/05/14/the-aspnet-compiler-build-task-in-visual-studio-2010-asp-net-mvc-2-projects.aspx\">post这给了我答案。保持MvcBuildViews为真正,然后你可以在你的项目文件下添加以下行:
<$p$p><$c$c><BaseIntermediateOutputPath>[SomeKnownLocationIHaveAccessTo]</BaseIntermediateOutputPath>
和使该文件夹不在您的项目的文件夹中。对我的作品。这不是一个完美的解决方案,但它是很好的时刻。请确保您删除在包文件夹(位于里面的 OBJ \\调试和/或 OBJ \\发布文件夹)从项目文件夹中,否则你'会不断收到错误。
FWIW,<一个href=\"http://connect.microsoft.com/VisualStudio/feedback/details/556312/mvcbuildviews-does-not-play-well-with-one-click-publish\">MS知道这个错误 ...
I can run my Asp.Net MVC 2 application without an issue on my local computer. Just Run / Debug.
But if I have already built it, I can't publish it! I have to clean the solution and publish it again. I know this is not system critical, but it's really annoying. "One Click Publish" is not "Clean solution and then One click publish"
The exact error is as follows:
Error 11 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 suspect it's something to do with the Web.Config in the Views folder, but then why only after I build once previously. And just to note, the app works fine once published.解决方案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...
这篇关于allowDefinition的='MachineToApplication'的错误时,从VS2010(但previous构建后只)发布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!