0

So I've just downloaded MahApps.Metro demo project from github. I loaded the demo using Visual Studio 2013 and compiled the MahApps.Metro.Demo.Net45 version, and I got over 100 of errors of all variety. When I check the code to see what caused the errors, I dont think there's anything wrong with the syntax. The assembly listed for every class looks fine as well.

For example:

internal static KeyboardNavigationEx Instance => _instance ?? (_instance = new KeyboardNavigationEx());

The code above, caused " ; expected " error at the lamda sign. Why is this an error?

Here's some screenshot of the other errors I got. https://i.stack.imgur.com/KmcTq.jpg https://i.stack.imgur.com/SMshm.jpg

What am I missing here? Is the problem with my Visual Studio? I've updated my Visual Studio with Update 5, but errors still remain when I compiled the demo again. Is the problem with the MahApps demo? If so, is there a working version that I can try? Can you please share some links? I'm really puzzled. Any advice on how to try the demo project succesfully?

halfer
  • 19,824
  • 17
  • 99
  • 186
jbv_eng
  • 21
  • 4
  • 1
    These expressions in the form presented are available since C# 7.0 which ( from what I know ) is unavailable inside VS 2013. Try using VS 2017. – mrogal.ski May 08 '17 at 13:01
  • thanks for replying m.rogalski. quick question, can I get C# 7.0 if I install the latest .Net framework to my VS2013? What about VS2015? does it have C# 7.0? What are my options other than getting VS2017? – jbv_eng May 08 '17 at 15:54
  • Check [this answer](http://stackoverflow.com/a/43048660/3179310) – mrogal.ski May 08 '17 at 15:58
  • 1
    @jbv_eng You need min VS 2015, cause we use C# 6.0 – punker76 May 09 '17 at 07:34

1 Answers1

2

(Posted on behalf of the OP).

Fixed it. Installed VS2015 which include C# 6.0. I can now build successfully.

halfer
  • 19,824
  • 17
  • 99
  • 186