Skip to content

JSImport and SupportedOSPlatform("browser") #121165

Closed

Description

@jjonescz

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

JSImportAttribute has SupportedOSPlatform("browser") which seems useless - having SupportedOSPlatform on the attribute itself has no effect when the attribute is applied to a method.

Expected Behavior

The JSImport source generator should instead apply SupportedOSPlatform("browser") to the partial method implementation parts, so warnings like CA1416 are properly reported when the method is used from non-browser code.

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

.NET 10 RC2

Anything else?

No response

Activity

  1. added
    needs-area-label
    on Oct 28, 2025
  2. removed
    needs-area-label
    on Oct 28, 2025
  3. ilonatommy commented on Oct 29, 2025

    @ilonatommy
    Member

    This looks like runtime issue

  4. added
    untriaged
    on Oct 29, 2025
  5. added
    needs-area-label
    on Oct 29, 2025
  6. added
    source-generator
    and removed
    untriaged
    needs-area-label
    on Oct 29, 2025
  7. added
    arch-wasm
    on Oct 29, 2025
  8. dotnet-policy-service commented on Oct 29, 2025

    @dotnet-policy-service
    Contributor

    Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
    See info in area-owners.md if you want to be subscribed.

  9. removed their assignment
    on Oct 29, 2025
  10. added a commit that references this issue on Jul 20, 2026
    b02a4fe
  11. locked and limited conversation to collaborators on Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

arch-wasmarea-System.Runtime.InteropServices.JavaScriptsource-generator

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions