Search code examples
razorservicestack-razor

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


I am using ServiceStack (self hosted) with Razor.

I have an issue trying to add System.Core to the namespaces in the web.config file.

Specifically, I get a compilation error if I include System.Core in the web.config.

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;

Extract of Web.config file:

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


Solution

  • System.Core is not a namespace its is an assembly