Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

All alternatives of an attribute with FrameworkAlternate are shown regardless of framework selected #2851

Open
Labels
Pri3Indicates issues/PRs that are low priorityarea-System.Runtimedocs-experienceIndicates issues that are about the learn.microsoft.com experience or designexternalNot related to content
Milestone
@mikkelbu

Description

@mikkelbu

I discovered this when I was reading up on the SecuritySafeCriticalAttribute class on
https://docs.microsoft.com/en-us/dotnet/api/system.security.securitysafecriticalattribute?view=netframework-4.8. This class have the following code snippet which does not make sense since there can only be oneAttributeUsage on a class.

[System.AttributeUsage(System.AttributeTargets.Class|System.AttributeTargets.Struct|System.AttributeTargets.Enum|System.AttributeTargets.Constructor|System.AttributeTargets.Method|System.AttributeTargets.Field|System.AttributeTargets.Interface|System.AttributeTargets.Delegate,AllowMultiple=false,Inherited=false)][System.AttributeUsage(System.AttributeTargets.Class|System.AttributeTargets.Constructor|System.AttributeTargets.Delegate|System.AttributeTargets.Enum|System.AttributeTargets.Field|System.AttributeTargets.Interface|System.AttributeTargets.Method|System.AttributeTargets.Struct,AllowMultiple=false,Inherited=false)][System.AttributeUsage(System.AttributeTargets.All,AllowMultiple=false,Inherited=false)]publicsealedclassSecuritySafeCriticalAttribute:Attribute

Examining the "code-behind" -https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System.Security/SecuritySafeCriticalAttribute.xml - reveals that eachAttributeUsage is for a different moniker. I would have expected that changing the product and version on the page would effect the code snippet such that only the relevantAttributeUsage was shown. As it is now one can only know the correctAttributeUsage by examining the xml file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pri3Indicates issues/PRs that are low priorityarea-System.Runtimedocs-experienceIndicates issues that are about the learn.microsoft.com experience or designexternalNot related to content

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp