Reputation: 55
I've searched all over the internet for an answer to what seems to be a very basic question, so I'm sure I'm missing something obvious here. I'm in the process of upgrading me and my team to Visual Studio 2017, however, when I attempt to use new C# 7 language features, I get red squigglies. The code still compiles and runs; it's like the IDE isn't picking up the new features, though. I've added Microsoft.Net.Compilers via NuGet, and I still get the squigglies. I've attached a screenshot of a very contrived example for references (null value exception propagation).
For what it's worth, I have the latest version of ReSharper installed. Also, Roslyn suggests C#7 code fixes, and they get fixed correctly, but I still have the red squigglies.
Upvotes: 2
Views: 456
Reputation: 244757
The latest version of ReSharper (2016.3) does not have full C# 7.0 support, so I think it's quite possible that's causing the issue.
Your code works fine for me with ReSharper 2017.1 EAP 4, including correctly marking the throw
expression as not accessible. So you might want to try upgrading to that, if you're willing to use pre-release software.
Upvotes: 5