Search code examples
visual-studiomsbuilddotnet-sdk

CS1617: Invalid option '10' for /langversion


While building this open source C# project in AppVeyor, I get the error:

CSC : error CS1617: Invalid option '10' for /langversion. Use '/langversion:?' to list supported values.

See the build log.

In build settings, Visual Studio 2022 is selected as the build worker image and the Preinstalled Software page lists both .NET 5 and 6 SDKs for that image.

What am I missing? Why is it using MSBuild 16 and not 17?


Solution

  • The problem was that appveyor.yml in the repo had Visual Studio 2019 in it as the worker image. The way AppVeyor works, the yml file takes precedence over UI settings.