The project is not compiled in MSVS2015 under the .NET Framework 4.5. Apparently the compiler does not understand the expression C # 6.0 with the members going into the expressions. If you need a Roslyn compiler, then how to install / set it in the studio? Or am I digging in the wrong direction and the problem is something else?

enter image description here

Link to the project: https://github.com/yarseyah/sentinel

Code that does not compile:

private void AddCopyCommandBinding() { void Handler(object s, ExecutedRoutedEventArgs a) { CopySelectedLogEntries(); } var command = new RoutedCommand("Copy", typeof(GridView)); command.InputGestures.Add(new KeyGesture(Key.C, ModifierKeys.Control, "Copy")); messages.CommandBindings.Add(new CommandBinding(command, Handler)); try { Clipboard.SetData(DataFormats.Text, string.Empty); } catch (COMException) { } } 
  • one
    @PavelMayorov, obviously, this is not required in this case. - Qwertiy pm
  • one
    Look for language version in project properties. - Qwertiy 2:41 pm
  • one
    @Qwertiy is not obvious ... - Pavel Mayorov
  • one
    @PavelMayorov What will happen if I remove the screen and link? I wrote in the question that I didn’t know what was going on and this was only an assumption - swd
  • one
    2017 studio needs to be installed ... - Pavel Mayorov

2 answers 2

https://stackoverflow.com/a/43048660/2856962

You can replace the compiler that comes with Visual Studio with the version that supports C # 7 by installing the Microsoft.Net.Compilers Nuget package

But, as the author of the answer writes, the studio will still emphasize unknown constructions. Although the code will be compiled.

    You must install Visual Studio 2017.