Skip to content

Visual Studio does not suggest changing the language version to preview when using generic attributes. #58742

@teo-tsirpanis

Description

@teo-tsirpanis

Version Used: Visual Studio 2022 17.0.4

Steps to Reproduce:

Create a new project and paste the following code:

using System;

[assembly: Test<int>]

class TestAttribute<T> : Attribute
{

}

Expected Behavior:

Visual Studio would display error CS8652 and suggest to set the language version to preview.

Actual Behavior:

Visual Studio does display the error but doesn't offer to fix the language version. Since we can't change it visually from the Properties page, we have to directly edit the project file.

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions