[Azure Bot Service, C#]Can not compile C# 7 syntax
I'm not able to compile on Azure, but I can compile locally. The errors I'm getting are because Azure doesn't understand the new C# syntax. I'm getting error for inline getters and setters as well as errors for pattern matching in my case statements.
Is there a way to update my Azure resource?
EX: private string _name; public string Name { get => _name; // Error here set => _name = value; // Error here }
switch(myObj) { case Interface1 i : // error here break; case Interface2 i : // error here break; }
@sposaro You are using lambda expressions on getters and setters. getter lambda expression supported since C#6, setter lambda expression is added in C#7 make sure to set your azure app service to c#7 if supported by Azure.
Hi @sposaro
Great question!
Azure Functions use a very recent version of Roslyn, and C#7 syntax should work without issue. What is the rest of your code?
Here is an example:

@EricDahlvang I just sent you an email with an actual code snippet along with the error logs. However, it clear doesn't not like the new pattern matching syntax or the inline setters.
@msmohan I'm not sure where that setting you speak of is. Am I looking in the correct place.

@sposaro Are you getting CS1043 and CS1513 errors, as shown below?

@EricDahlvang and I looked into this.
As a workaround you can update the following references to its latest version in order to make lambda expressions to work on C#7.
- Microsoft.CodeDom.Providers.DotNetCompilerPlatform ver: 2.4.0
- Microsoft.Net.Compilers ver: 1.0.8
This is discussed here at project Kudu
We can repro this issue on WEB and LOCAL and we will escalate the issue with Azure Support team.

Closing this, since it is not directly related to the Bot Framework, we have a workaround, the root cause has been found and escalated to the responsible team.