您的位置:首页 > 产品设计 > UI/UE

There is no build provider registered for the extension '.cshtml'.

2012-07-18 14:20 381 查看
There is no build provider registered for the extension '.cshtml'. You can register one in the <compilation><buildProviders> section in machine.config or web.config. Make sure is has a BuildProviderAppliesToAttribute attribute
which includes the value 'Web' or 'All'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: There is no build provider registered for the extension '.cshtml'. You can register one in the <compilation><buildProviders> section in machine.config or web.config. Make sure is has
a BuildProviderAppliesToAttribute attribute which includes the value 'Web' or 'All'.



web.config修改:

<compilation debug="true" targetFramework="4.0">

<assemblies>

<add assembly="System.Web.WebPages.Razor, Version=1.0.0.0,Culture=neutral,PublicKeyToken=31BF3856AD364E35" />

</assemblies>

<buildProviders>

<add extension=".cshtml" type="System.Web.WebPages.Razor.RazorBuildProvider, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

</buildProviders>

</compilation>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐