Razor - 无法将 System.Core 添加到 Web.Config

Razor - unable to add System.Core to Web.Config

我正在将 ServiceStack(自托管)与 Razor 一起使用。

我在尝试将 System.Core 添加到 web.config 文件中的命名空间时遇到问题。

具体来说,如果我在 web.config 中包含 System.Core,则会出现编译错误。

Compilation Error

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 'Core' does not exist in the namespace 'System' (are you missing an assembly reference?)

Source Error:

Line 12: using System; Line 13: using System.Collections.Generic; Line 14: using System.Core; Line 15: using System.Data; Line 16: using System.IO;

Web.config 文件的摘录:

  <system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc" />
<pages pageBaseType="ServiceStack.Razor.ViewPage">
  <namespaces>
    <add namespace="System" />
    <add namespace="System.Core" /> **-> THIS GIVES AN ERROR**
    <add namespace="System.Data" />
    <add namespace="System.Linq" />
    <add namespace="ServiceStack" />
    <add namespace="ServiceStack.Html" />
    <add namespace="ServiceStack.Razor" />
    <add namespace="ServiceStack.Text" />
    <add namespace="ServiceStack.OrmLite" />
    <add namespace="Classifieds" />
    <add namespace="Classifieds.ServiceModel" />
    <add namespace="Classifieds.ServiceInterface" />
  </namespaces>
</pages>

System.Core 不是命名空间它是一个程序集