我有一個似乎已經在這裏報告了一個問題:剃刀編譯器警告/錯誤 - ASP.NET MVC 4
Need razor view engine auto-complete to work in a class library?
我的問題是以下警告:
G:\Accountable\Accountable\Views\LedgerUser\EditorTemplates\LedgerServiceViewModel.cshtml: ASP.NET runtime error: There is no build provider registered for the extension '.cshtml'. You can register one in the section in machine.config or web.config. Make sure is has a BuildProviderAppliesToAttribute attribute which includes the value 'Web' or 'All'.
這我的觀點顯而易見。下面的示例圖像。
現在的所有帖子,並在網上,我發現引用引用來添加各種Web.config文件(如前面的文章中提到)的選擇,但是這並未似乎沒有用,因爲我在這個項目中默認了這些配置。這裏是我的Web CONFIGS:
我想這個問題也許同時IM也越來越上查看以下編譯器錯誤:
The name 'Html' does not exist in the current context
什麼我做錯了嗎?
這一個幾乎重複:http:// stackoverflow。com/questions/4158573/need-razor-view-engine-auto-complete-to-work-in-a-class-libraries –
嘿大衛。感謝您的評論。是的,我在上面的帖子中提到過。我看不出在項目中創建的默認區別。 – garfbradaz