将视图添加到 bin 部署集会导致错误
我正在为 bin 部署设置 ASP.Net MVC 应用程序。由于我想在发行版中包含已编译的视图,因此我遵循 Steven Sanderson 的 Pro MVC 书中的建议,并更改了我的 app.csproj 文件以包含
<Target Name="AfterBuild" Condition="'$(Configuration)'=='Release'">
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(ProjectDir)" />
</Target>
不幸的是,此更改导致我出现构建错误。
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. C:\Users\sylvie\Documents\Visual Studio 2010\Projects\app\app\obj\release\package\packagetmp\web.config
知道如何处理错误消息或以不同的方式将编译后的视图放入 bin 目录中吗?
谢谢! 达菲
I am setting up an ASP.Net MVC app for bin deployment. Since I would like to include the compiled views in the release I followed the advice from Steven Sanderson's Pro MVC book and changed my app.csproj file to include
<Target Name="AfterBuild" Condition="'$(Configuration)'=='Release'">
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(ProjectDir)" />
</Target>
Unfortunately, this change is causing me a build error.
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. C:\Users\sylvie\Documents\Visual Studio 2010\Projects\app\app\obj\release\package\packagetmp\web.config
Any idea how to either deal with the error message or get the compiled views into the bin dir in a different way?
Thanks!
Duffy
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无需整理您的观点。这就是 ASP.NET 的工作。您可以简单地浏览这篇博文,一切都应该工作得很好。
You don't need to compile your views. That's the job of ASP.NET. You could simply go through this blog post and everything should work just fine.