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

Source generator must always prepend all usings and namespace references with global:: #8170

Open
xperiandri opened this issue Feb 23, 2022 · 2 comments
Labels
area/code-generation Categorizes an issue or PR as relevant to code generation difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/bug Something isn't working

Comments

@xperiandri
Copy link
Contributor

Current behavior

The source generator does not always prepend all usings and namespace references with `global::``

Expected behavior

The source generator does always prepend all usings and namespace references with `global::``

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

Create any class in the namespace <SolutionName>.Windows.
After that, you won't be able to build the app because of the namespace issue in the code generated from App.xaml

Workaround

Do not use namespaces that contain Windows in their segment

Works on UWP/WinUI

Yes

Environment

Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia

NuGet package version(s)

4.2.0-dev.100

Affected platforms

iOS, Android, WebAssembly, macOS, Skia (WPF), Skia (GTK on Linux/macOS/Windows), Skia (Tizen)

IDE

Visual Studio 2022

IDE version

17.1 preview

Relevant plugins

No response

Anything else we need to know?

No response

@xperiandri xperiandri added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Feb 23, 2022
@jeromelaban jeromelaban added area/code-generation Categorizes an issue or PR as relevant to code generation difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI and removed triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Feb 23, 2022
@xperiandri xperiandri changed the title Source generator must always prepend all usings and namespace references with global::` Source generator must always prepend all usings and namespace references with global:: Jul 6, 2023
@xperiandri
Copy link
Contributor Author

@jeromelaban can anyone point out where this happens and what tests to execute?

@jeromelaban
Copy link
Member

@xperiandri this would be in https://github.com/unoplatform/uno/tree/master/src/SourceGenerators/Uno.UI.SourceGenerators.netcore.Tests, as we're already doing some testing there for these scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/code-generation Categorizes an issue or PR as relevant to code generation difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants