1

I understand that in the C#10 new features that I'm able to create Generic Attributes, however despite setting the target framework to .NET 6.0 the compiler is still throwing the CS0698 error.

I'm currently using Visual Studio 2019 but as far as I know having the SDK installed should allow me to utilize this feature, additionally I have preview features enabled but still no luck

enter image description here enter image description here

I saw a user mention this in a comment, but I still can't get it to work https://stackoverflow.com/a/69949881/17399588

How can I get this to work?

EDIT: Have tried Flydog57's answer but am still getting the same issues

K R
  • 21
  • 2
  • 3
    From: https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-10: _""_Additional features are available in preview mode. You're encouraged to try these features and provide feedback on them. They may change before their final release. In order to use these features, you must set to Preview in your project. Read about Generic attributes later in this article."_ And then, when you find `Generic Attributes`, it has this: _"Generic attributes is a preview feature. You must set to Preview to enable this feature. This feature may change before its final release."_ – Flydog57 Nov 13 '21 at 00:37
  • I've done this but I'm still getting the same error – K R Nov 13 '21 at 00:59
  • You probably want to mention that in the question. – Flydog57 Nov 13 '21 at 01:06
  • Apologies, I just tried this and edited the post – K R Nov 13 '21 at 01:09

0 Answers0