Open jeromelaban opened 2 years ago
@jeromelaban Can GlobalStaticResources
be internal or other? This error is confusing. Thank you.
And I find it may hard to change to internal...
How can I avoid this problem?
Do not have the same root namespace for two assemblies project. Please make sure that no more than one RootNamespace in your csproj[s] is the same.
We do not have a fix for this yet, the only way around this is to avoid having the same default namespace for assemblies.
@jeromelaban For me, having the same default namespace is very common. And the error messages here are confusing.
Current behavior
When building an application, the following message may arise:
Expected behavior
The compilation succeeds.
How to reproduce it (as minimally and precisely as possible)
Craete an application which contains two projects that use the same default C# namespace.
Workaround
Change the default namespace to be different for each assemblies.
Works on UWP/WinUI
Yes
Environment
No response
NuGet package version(s)
4.2.6
Affected platforms
No response
IDE
No response
IDE version
No response
Relevant plugins
No response
Anything else we need to know?
This issue is caused by the fact that the code generator uses the default namespace to create the
GlobalStaticResources
class, and uses it in App.xaml generation to initialize resources. These types conflict because they can be found in two assemblies, with the same qualified name.