I am attempting to update a WPF app from .NET Framework 4.7.2 to .NET 8. Using the Upgrade option in Visual Studio, I have updated all of my projects and resolved my dependencies.
What I can't figure out is why I am getting several errors that look like this:
- XamlC error XFC0000: Cannot resolve type "Application".
- XamlC error XFC0000: Cannot resolve type "Window".
- XamlC error XFC0000: Cannot resolve type "UserControl".
Googling this brings back results for .NET Maui an Xamarin, I don't think either of these apply to me.
How do I fix these errors? Am I missing something?
Converting a WPF project from .NET Framework to .NET Core/6/7/8/etc. can be a little tricky because while the code and XAML shouldn't need changes, the project files are completely different as are the output files.
If having any trouble making the conversion (whether manual or automated), these would be the standard troubleshooting steps to try:
<UseWPF>true</UseWPF>
property in addition to <TargetFramework>netX.0-windows</TargetFramework>
.