I have created a new project in dotnet 8 / C#12. Some of the new C#12 features are well recognised by Visual studio, for example I can do this without any errors:
public class MyClass(string parameter) {...}
while it does not work in another project in dotnet 7 (so far so good).
The problem is: when I use the new syntax to create arrays/lists:
int[] a = [1, 2, 3, 4, 5, 6, 7, 8];
the IDE doesn't recognise the syntax at all. I can compile my code correctly and run it without any errors. The error is displayed only in the IDE, it doesn't actually exist when I run the project.
Visual Studio behaves as if it were only partially aware of the new features in C#12
How can I correct this problem, if possible without reinstalling Visual Studio? Thanks
Currently ReSharper does not fully support .NET 8 SDK - see the .NET SDK support in JetBrains Rider doc. Current EAP version (Which is EAP 8 ATM) seems to have this issue fixed so install it.