In my case, similar to Basim, there was a NuGet package that was telling the compiler we needed C# 6, which we didn't.
We had to remove the NuGet package Microsoft.CodeDom.Providers.DotNetCompilerPlatform
which then removed:
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform"version="1.0.0" targetFramework="net452" />
from thepackages.config file<system.codedom><compilers><compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" /><compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+" /></compilers></system.codedom>
In the system.codedom
node, you can see why it was bringing in roslyn: compilerOptions="/langversion:6