C# "record" doesn't work

Hi. I can't get Rider to recognize the word “record.”

Example of usage: public record Point(float X, float Y);

Anyone know what the deal is? Some sort of missing dependency perhaps? Everything else is working perfectly (so far.)

0
2 comments

Hello A ,

Thank you for reaching Rider forum.

Could you please check your <TargetFramework> and <LangVersion> in the .csproj file? 

 

0

Setting <LangVersion> to “latest” fixed this issue. Thank you.
I'm a little confused as to why this isn't the default for all new solutions.

0

Please sign in to leave a comment.