title: The type or namespace name 'System' could not be found
body: <p>I have the following errors (and more) in all my views (*.cshtml) when opening my project in Visual Studio 2015 Professional.</p>
  
  <blockquote>
    <p>Error  CS0246  The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
    Severity    Code    Description Project File    Line</p>
    
    <p>Error  CS0518  Predefined type 'System.Object' is not defined or imported
    Severity    Code    Description Project File    Line</p>
    
    <p>Error  CS0518  Predefined type 'System.String' is not defined or imported</p>
  </blockquote>
  
  <p>I got these references:</p>
  
  <pre><code>&lt;ItemGroup&gt;
  &lt;Reference Include="Microsoft.CSharp" /&gt;
  &lt;Reference Include="Sitecore.Kernel, Version=7.0.0.0, Culture=neutral, processorArchitecture=MSIL"&gt;
    &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
    &lt;HintPath&gt;N:\XXX\Sitecore.Kernel.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="Sitecore.Mvc"&gt;
    &lt;HintPath&gt;N:\XXX\Sitecore.Mvc.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="System.Web.DynamicData" /&gt;
  &lt;Reference Include="System.Web.Entity" /&gt;
  &lt;Reference Include="System.Web.ApplicationServices" /&gt;
  &lt;Reference Include="System.ComponentModel.DataAnnotations" /&gt;
  &lt;Reference Include="System" /&gt;
  &lt;Reference Include="System.Data" /&gt;
  &lt;Reference Include="System.Core" /&gt;
  &lt;Reference Include="System.Data.DataSetExtensions" /&gt;
  &lt;Reference Include="System.Web.Extensions" /&gt;
  &lt;Reference Include="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"&gt;
    &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
    &lt;HintPath&gt;N:\XXX\System.Web.Helpers.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"&gt;
    &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
    &lt;HintPath&gt;N:\XXX\System.Web.Mvc.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="System.Web.Providers"&gt;
    &lt;HintPath&gt;N:\XXX\System.Web.Providers.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"&gt;
    &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
    &lt;HintPath&gt;N:\XXX\System.Web.Razor.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"&gt;
    &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
    &lt;HintPath&gt;N:\XXX\System.Web.WebPages.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"&gt;
    &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
    &lt;HintPath&gt;N:\XXX\System.Web.WebPages.Deployment.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"&gt;
    &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
    &lt;HintPath&gt;N:\XXX\System.Web.WebPages.Razor.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="System.Xml.Linq" /&gt;
  &lt;Reference Include="System.Drawing" /&gt;
  &lt;Reference Include="System.Web" /&gt;
  &lt;Reference Include="System.Xml" /&gt;
  &lt;Reference Include="System.Configuration" /&gt;
  &lt;Reference Include="System.Web.Services" /&gt;
  &lt;Reference Include="System.EnterpriseServices" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>I found some solutions saying that a mscorlib wasn't referenced.. but when I tried to add it it sayd that it's already there (even though I don't see it on the csproj file).</p>
  
  <p>System.dll reference:</p>
  
  <p><a href="https://i.stack.imgur.com/B2fEv.jpg"><img src="https://i.stack.imgur.com/B2fEv.jpg" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/A9ojv.jpg"><img src="https://i.stack.imgur.com/A9ojv.jpg" alt="enter image description here"></a></p>
  
  <p><strong>SOLUTION:</strong> </p>
  
  <p>Managed the issue.. I had the build path set to a "c:...\bin" instead of "\bin". I believe this happened because I don't have any web.config in the root of the project, so VS didn't identify my project as a web project.</p>