Unable to parse valid C# property code
The following code for a property is valid, and the project can compile. However, ReSharper does not recognize it, and makes everything red, plus types using the class will also show as error.
public string SubtitleHtml { get => string.Empty; }
Please sign in to leave a comment.
Are you able to reproduce the same issue in a demo project?
Thanks!
Yes. It's the syntax with get => inside curly brackets that is not supported by ReSharper. But it still compiles fine.
You try to copy paste that property into any class and look for yourself.
What type of project did you try - WebApp, Console App, Class Lib?
What Visual Studio version do you use?
I pasted the code to a newly created project in VS2017 and it was correctly resolved:
Thanks!
Hmm..
It was a Console App. I am using VS 2017. Maybe my ReSharper is up to date.
I guess if it's working on your end, you can close this.
Are you able to send me this Console App where you saw the issue? We need to understand what went wrong on your side.
By the way, what ReSharper build do you use?
Thanks!
As you can see, I'm still running on a rather old version, so that's probably it.
I tested on a completely new console app, and added the property. Still issues. So I'll probably just need to update.