Range usage with .net Framework
Hi,
Range is a c# 8.0 feature that is normally not available in .net Framework.
But I found this trick (https://www.meziantou.net/how-to-use-csharp-8-indices-and-ranges-in-dotnet-standard-2-0-and-dotn.htm) that works quite well. The code is compiling, and I can use Range in my code.
But Resharper is underlining it in Red, even if it's compiling (I tried to suspend Resharper, and the red underline goes away).
Is there a way to avoid it ? is this a Resharper bug ?
Thanks for your help
Please sign in to leave a comment.
Hello Alain,
Could you please let me know what "C# Language Level" is set for the project in Properties tool window? Is the issue still reproduced if you change it to C# 8?
Thank you.
Hello Angelina,
My project's language level was in "Default (autodetect)".
Changing it to c#8 make things worse, as I was also trying Init only feature.
Changing it to c#9, same symptoms as original post.
Changing it to c#10, "Latest supported" or "Preview" always give the same error.
I can give you a minimal project to reproduce it if you want.
Thanks in advance for your help,
Alain
Hello Alain,
Having the project will be great, thanks! Could you please upload it using our service?
Hello Angelina,
Upload done :
Upload id: 2022_02_07_NN5GEDrb3ej3ZqFG (file: TestCrossDotNetVersion.zip)
Thank you
Hello,
I've filed a corresponding issue - https://youtrack.jetbrains.com/issue/RSRP-487877
Please follow it to get the latest updates, you are welcome to comment on it as well.
Thank you.