我使用Spark 1.5視圖引擎在ASP.NET MVC3中構建了一個Web應用程序 - 在我的本地開發機器上正常運行,但在Windows Azure上託管時它可以找不到Spark Views。我得到以下標準錯誤屏幕:在Windows Azure中呈現Spark視圖ASP.NET MVC3 web應用程序
The view 'Logon' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Account/Logon.aspx
~/Views/Account/Logon.ascx
~/Views/Shared/Logon.aspx
~/Views/Shared/Logon.ascx
~/Views/Account/Logon.cshtml
~/Views/Account/Logon.vbhtml
~/Views/Shared/Logon.cshtml
~/Views/Shared/Logon.vbhtml
Account\Logon.spark
Shared\Logon.spark
在我看來,星火未搜索相同的文件夾,Web窗體/剃刀(因爲沒有〜/瀏覽次數前綴),但我找不到在哪裏,這是在配置火花。
我試着添加以下的啓動代碼:
settings.AddViewFolder(ViewFolderType.VirtualPathProvider,new Dictionary<string, string> { { "virtualBaseDir", "~/Views/" } });
...但沒有改變。不禁感覺有一些盲目明顯的我失蹤了。
羅布 - 感謝指針。你說得對,Spark文件沒有複製到Azure,但爲了解決這個問題,我必須將每個Spark文件的Build Action設置爲Content(當添加Razor視圖時,默認情況下Build Action會設置爲Content,但是當添加Spark視圖時,Build Action會被設置爲None)。很高興我已經完成了這件事 - 害怕不得不降級到剃刀; 0)。 – kenxl 2011-02-16 13:42:30