我的剃刀视图无法编译,并出现以下错误:
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0234: The type or namespace name 'Helpers' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
我添加了System.Web.Helpers作为对我项目的引用,所以我不确定还需要做什么。我在添加引用后也尝试了一个干净的重建,没有任何改变。
我错过了什么?
答案 0 :(得分:30)
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
到web.config的<assemblies>
部分!
答案 1 :(得分:3)
Web.config行应该放在这里:
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />