Skip to content

<Using Remove..../> does not work in Uno.Sdk projects #18525

Description

@mikernet

Current behavior

When implicit usings are enabled, <Using Remove="Uno.UI"/> appears to have no effect in Uno.Sdk projects.

Expected behavior

It should not add global using global::Uno.UI; to the auto-generated GlobalUsings.g.cs file.

How to reproduce it (as minimally and precisely as possible)

Add

<ItemGroup>
  <Using Remove="Uno.UI" />
</ItemGroup>

To the a csproj file that uses Uno.Sdk and notice that the global implicit using for Uno.UI is still added. Haven't tested it with any of the other implicit usings but if it does not work then it should.

Workaround

Needed to add a dummy class to the Uno.UI namespace so it doesn't error out in a library project using Uno.Sdk (I configured the -windows target not to have any Uno references).

Works on UWP/WinUI

None

Environment

Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia

NuGet package version(s)

5.2.8 - 5.4.10

Affected platforms

No response

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

Activity

  1. added
    difficulty/tbd
    kind/bug
    triage/untriaged
    on Oct 21, 2024
  2. added
    difficulty/starter 🚀
    kind/papercut
    area/sdk
    and removed
    triage/untriaged
    difficulty/tbd
    on Oct 22, 2024
  3. added theissue type on Jun 20, 2025
  4. github-actions commented on May 7, 2026

    @github-actions
    Contributor

    This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.

  5. added
    stale
    on May 7, 2026
  6. removed
    stale
    on May 9, 2026
  7. github-actions commented on Oct 18, 2026

    @github-actions
    Contributor

    This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.

  8. added
    stale
    on Oct 18, 2026
  9. mikernet commented on Oct 18, 2026

    @mikernet
    ContributorAuthor

    Still an issue on master. The Uno.Sdk adds its implicit Using items in Uno.Implicit.Namespaces.targets, which is imported from Sdk.targets, after the project file, so a <Using Remove="Uno.UI" /> in the project runs before the item it is meant to remove. The only way out today is DisableImplicitUnoNamespaces, which drops all of them. I'm preparing a PR so that Remove works and a namespace isn't added when nothing in the project provides it.

  10. removed
    stale
    on Oct 19, 2026
  11. added a commit that references this issue on Nov 12, 2026
    9cd4fab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/sdkdifficulty/starter 🚀kind/bugkind/papercut

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions