Skip to content

LibraryImportGenerator should generate code using "global::" #86786

Closed

Description

@Lightczx

Description

When I have a extern method placed in a namespace contains System
(For example: when using it with CsWin32, we have a namespace called Windows.Win32.System)
The LibraryImport will place the generated code in the same namespace, thus it can't find:

[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "7.0.8.17405")]
[System.Runtime.CompilerServices.SkipLocalsInitAttribute]

and report several CS0234
Because there is no Windows.Win32.System.CodeDom and Windows.Win32.System.Runtime

Activity

  1. ghost added
    untriaged
    on May 26, 2023
  2. removed
    untriaged
    on May 26, 2023
  3. added this to the 8.0.0 milestone on May 26, 2023
  4. AaronRobinsonMSFT commented on May 26, 2023

    @AaronRobinsonMSFT
    Member

    This should be an easy fix. Thanks @Lightczx for reporting it.

  5. ghost added
    in-pr
    on Jun 13, 2023
  6. ghost removed
    in-pr
    on Jun 13, 2023
  7. ghost locked as resolved and limited conversation to collaborators on Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions