I'm making a UWP Windows app in C# using WinUI 3.0 and a few days ago I started getting this kind of error:
CS0433 The type 'NavigationView' exists in both 'Microsoft.UI.Xaml, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' and 'Microsoft.UI, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime'
This is the snippet from the auto generated code that causes the error:
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.UI.Xaml.Markup.Compiler"," 0.0.0.0")]
private global::Microsoft.UI.Xaml.Controls.NavigationView settingsNavPane;
Until now, I solved instances of this issue by deleting /bin
and /obj
's contents, but the problem seems to persist.
I'm aware this is a compiler error, so I tried adding a reference to the .csproj file:
<References>
<Reference Include="Microsoft.UI.Xaml.dll"/>
</References>
I don't know if I'm missing something obvious, but this didn't solve the problem either. How do I fix this?