6

I know people have asked this question before and I tried their solutions but I still have problems.

In short:

my code compiles and I can browse the page and everything, but VS keep showing me the error

Error CS8026 Feature 'null propagating operator' is not available in C# 5.
Please use language version 6 or greater.

enter image description here

I went through all answers here:

C# 6.0 Features Not Working with Visual Studio 2015

What Do I have

  • VS 2015 update 3, ReSharper Ultimate 2017.1.2, MVC 5

  • latest version of codedome

  • This section in my webconfig

Code

  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.4.0, Culture=neutral, Pub[1]licKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:7 /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.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:15 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
    </compilers>
  </system.codedom>

I tried .net framework 4.6.1 and 4.6.2

.net version

Set language version to C# 6.0 on my build>advancedadvanced

I don't have the enable C# 6, button probably because it is already enabled for the compiler. enter image description here

  • I have Resharper installed but I've closed and reopened visual studio several times. it didn't work
Community
  • 1
  • 1
Ashkan S
  • 10,464
  • 6
  • 51
  • 80

0 Answers0