1

Rider suggests to use C# 8 syntax, such as using declaration or async streams.

However, when I apply the recommended refactor, build fails on syntax errors.

My csproj.DotSettings file contains the language level set to latest:

<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
    <s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">latest</s:String>
...
</wpf:ResourceDictionary>

To clarify - I'm all for using C# 8. Where can I set the compiler target language? Or could it be just not supported yet?

In my project properties:

props

props

1 Answer 1

2

To use C# 8, you need to install MSBuild 16 and then write the exact version of the language in the project settings (csproj).

</PropertyGroup>
  ...
  <LangVersion>8</LangVersion>
</PropertyGroup>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.