Search code examples
c#.netdependenciesmaui

MAUI dependency errors


My issue:

I decided to build a .NET MAUI application. I installed the .NET Multi-Platform App UI Development and the .NET Desktop Development workloads. I did not at all alter my installation.

Here's the issue I'm facing (all dependencies have a yellow warning triangle with exclamation mark):

Issue

Edit: Right clicking on the dependencies prompts me to update them. After looking at the NuGet package manager, there are not updates. Even if I manually click on the packages.

And the error:

Error   NU1012  Platform version is not present for one or more target frameworks, even though they have specified a platform: net7.0-maccatalyst

It appears in the .csproj file.

The error though, is not very important to me, as I will only be building for Windows for now. If I wouldn't have disabled mobile platforms, it would show the error for them aswell.

What I've tried:

I tried reinstalling the workloads and completely re-creating the project but nothing worked. As soon as the project is created the errors appear. I also found some other posts about this issue, but none worked or helped. They also mostly had no answer to them at all.

My Visual Studio version is Visual Studio Community 2022 17.5.5 (Stable) and I'm using .NET 7 on Windows 10 22H2 19045.2965


Solution

  • You might not like the solution, but you have to completely repair Visual Studio. Reinstalling workloads does not help.

    Here's how to repair Visual Studio: Repair Visual Studio - Microsoft Learn