2
我有一個完全在我的本地IIS上工作的站點。將MVC站點部署到IIS導致它無法找到默認的共享局部視圖
我的所有頁面都使用默認的共享局部視圖,稱爲期望的_Layout.cshtml
。這個視圖被放置在我的共享文件夾中。這可以看這裏:
這工作完全,因爲我期望的那樣。
但是,我現在發佈我的網站。然後,我的一些在HomeController
外頁,導致:
The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Search/Index.aspx
~/Views/Search/Index.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx
~/Views/Search/Index.cshtml
~/Views/Search/Index.vbhtml
~/Views/Shared/Index.cshtml
~/Views/Shared/Index.vbhtml
這當然是正確的,但我希望它在我的共享文件夾中搜索_Layout.cshtml
,而不是這些文件的名稱。
我能做些什麼來解決它?爲什麼它能在我的本地IIS上運行,而不是在生產環境中運行?
爲什麼要調用'_Layout.cshtml'的默認動作搜索? – 2014-09-18 19:20:54
@WiktorZychla不好意思,你是什麼意思? – 2014-09-18 19:21:32
您是否設置了任何自定義路線? – 2014-09-18 20:28:00