Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Platform names should be in quotes #4008

Closed
terrajobst opened this issue Aug 13, 2020 · 3 comments
Closed

Platform names should be in quotes #4008

terrajobst opened this issue Aug 13, 2020 · 3 comments
Assignees
Labels
Area-Microsoft.CodeAnalysis.NetAnalyzers Bug The product is not behaving according to its current intended design

Comments

@terrajobst
Copy link
Contributor

Since our capitalization for platform names will be off, we should put it in quotes to make it clear that's a dynamic value, rather than being part of the error message.

Repro

static class Program
{
    public static void Main()
    {
        Some.WindowsSpecificApi();
    }
}

[SupportedOSPlatform("windows10.0")]
static class Some
{
    public static void WindowsSpecificApi()
    {
    }
}

Expected

'WindowsSpecificApi' requires windows 10.0 version or later

Actual

'WindowsSpecificApi' requires 'windows' 10.0 version or later

@terrajobst terrajobst added Bug The product is not behaving according to its current intended design Area-Microsoft.CodeAnalysis.NetAnalyzers labels Aug 13, 2020
@buyaa-n
Copy link
Contributor

buyaa-n commented Aug 14, 2020

Fixed

@Evangelink
Copy link
Member

I don't know how things work so I might say something utterly stupid but based upon [SupportedOSPlatform("windows10.0")] I would have expected the message to be 'WindowsSpecificApi' requires 'windows10.0' version or later.

@buyaa-n
Copy link
Contributor

buyaa-n commented Aug 27, 2020

Closing as the main issue is solved.

@Evangelink there is another issue you can participate which discussing the messaging improvements

@buyaa-n buyaa-n closed this as completed Aug 27, 2020
@jmarolf jmarolf added this to the .NET 5 RC1 milestone Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Microsoft.CodeAnalysis.NetAnalyzers Bug The product is not behaving according to its current intended design
Projects
None yet
Development

No branches or pull requests

4 participants