Search code examples
c#wpfvisual-studioxaml

Can't build WPF VS2022 solution


My Visual Studio 2022 solution won't build after I deleted the bin and obj folders of my C# WPF .NET 6.0 project.

The problem does not come from Visual Studio, as I've already tried reparing in Visual Studio Installer and I can build other WPF projects just fine. The errors shown in the output window:

C:\Users\Scover\source\repos\WinClean\WinClean\Presentation\App.xaml(11,6): error MC3074: The tag 'GoldenRatioConverter' does not exist in XML namespace 'clr-namespace:Scover.WinClean.Presentation.Converters'. Line 11 Position 6.

C:\Users\Scover\source\repos\WinClean\WinClean\Presentation\Controls\ScriptEditor.xaml(15,10): error MC3074: The tag 'IsNotNullConverter' does not exist in XML namespace 'clr-namespace:Scover.WinClean.Presentation.Converters'. Line 15 Position 10.

C:\Users\Scover\source\repos\WinClean\WinClean\Presentation\Windows\AboutWindow.xaml(7,9): error MC3050: Cannot find the type 'AppInfo'. Note that type names are case sensitive.

C:\Users\Scover\source\repos\WinClean\WinClean\Presentation\Windows\MainWindow.xaml(8,76): error MC3050: Cannot find the type 'AppInfo'. Note that type names are case sensitive.

C:\Users\Scover\source\repos\WinClean\WinClean\Presentation\Windows\SettingsWindow.xaml(8,62): error MC3050: Cannot find the type 'SettingsWindow'. Note that type names are case sensitive.

The problem doesn't come from junk files in the solution folder either, as I've already tried starting fresh by cloning my repository


Solution

  • Solved it. I just removed this line from my .csproj

    <AssemblyName>$(MSBuildProjectName)</AssemblyName>