var range = (first: 1, end: 10);
When I build the project, there is no error in Error List window. but the output window writes:
1>....cs(41,38,41,39): error CS1026: ) expected
1>....cs(41,40,41,41): error CS1001: Identifier expected
1>....cs(41,40,41,41): error CS1002: ; expected
1>....cs(41,41,41,42): error CS1002: ; expected
1>....cs(41,41,41,42): error CS1513: } expected
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Only when I remove the code var range = (first: 1, end: 10); can this project build success.
By the way, I'm using .NET Framework 4.6.2 (not .Net Core) and I've installed the package System.ValueTuple
I solved this issue by updating the package Microsoft.Net.Compilers (to version 2.x.x) and changing /langversion in the config file (web.config/app.config) to 7:
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:7 /nowarn:1659;1699;1701" />
    </compilers>
  </system.codedom> 
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With