2011-02-14 34 views
0

我正在爲bin部署設置ASP.Net MVC應用程序。因爲我想包括釋放已編譯的意見我也跟着從史蒂芬·桑德森的Pro MVC書的建議,改變了我的app.csproj文件,包括添加視圖到bin部署集導致錯誤

<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目錄?

謝謝! Duffy

回答

0

您不需要編譯您的視圖。這是ASP.NET的工作。你可以簡單地通過this blog post,一切都應該工作得很好。

+0

我已閱讀博客文章,它很有幫助。但是,Steven Sanderson的提示是關於編譯視圖以在發佈時捕獲視圖中的編譯時錯誤。你不必這樣做,但如果你不這樣做,最終偶爾會遇到生產中的錯誤觀點。 – duffy 2011-02-14 23:19:52

相關問題