簡體   English   中英

MVC中的Razor頁面給出了System.Web.Helpers找不到的編譯錯誤

[英]Razor pages in MVC are giving a compile error with System.Web.Helpers not being found

我的剃刀視圖無法編譯,出現以下錯誤:

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作為對我的項目的引用,所以我不確定我還需要做什么。 我在添加引用后也嘗試了一個干凈的重建,沒有任何改變。

我錯過了什么?

啊哈想出來了。 我需要補充一下

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

到web.config的<assemblies>部分!

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" />

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM