0

我正在为 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 目录吗?

谢谢!达菲

4

1 回答 1

0

您不需要编译您的视图。这就是 ASP.NET 的工作。你可以简单地浏览这篇博文,一切都应该很好。

于 2011-02-14T23:02:50.653 回答