ilk*_*ran 5 continuous-integration azure-devops azure-pipelines visual-studio-2019
I have a standard pipeline agent that works for CI whenever a pull request merged into master. It was working fine until I merged a pull request created by a visual-studio-2019 developed branch. Now I am getting
error CS8107: Feature 'default literal' is not available in C# 7.0. Please use language version 7.1 or greater.
It is working fine when I push any changes with vs2017.
What should I do to avoid this error?
P.S: I want to keep using vs2019
Thanks in advance.
This happen when you have code like the following:
MyType foo = default; // assign the default value for this type
In C# 7, the supported syntax is:
MyType foo = default(MyType);
but the simpler form was added in 7.1.
There are two ways to fix this:
default
to have a type, and change the settings so that the IDE will prefer the verbose form. Here's a picture with the new form turned on, just change the Yes to a No:
csharp_prefer_simple_default_expression
setting.latest
it may use a different version between your development box (VS2019) and your build agent (e.g. possibly still on VS2017).