I'm currently using the new throw expression in C# as such:
_configurator = configurator ?? throw new ArgumentException(nameof(configurator));
It compiles just fine inside Visual Studio 2017 however when deploying to my staging slot from my version control (in this case BitBucket) it fails with:
Repositories\UserRepository.cs(46,45): error CS1525: Invalid expression term 'throw' [D:\home\site\repository\foo\foo.csproj]
This occurs in several places across my project.
How can I set my WebApp to allow compilation of this new throw feature? The only workaround I found right now is to compile it locally and publish manually through Visual Studio. I would like to use the automated deployment option that Azure allows.
I found this error that relates to a local project but I'm not sure how to upgrade the Microsoft.Net.Compilers on the WebApp. My slot is set to .NET 4.6
Thanks,
Microsoft.Net.Compilersper David's answer solved the issue - Aaron Jordan