6

I wanted to start coding something using .NET MAUI, so I updated my VS2022 to "Version 17.1.0 Preview 6.0".
Then I installed these features using "Visual Studio Installer" as suggested in https://learn.microsoft.com/en-us/dotnet/maui/get-started/installation

enter image description here

Unfortunately when I create a basic MAUI app, I get several errors like this:

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

On developer command line I tried running dotnet workload list and got
android
ios
maui-android
maui-maccatalyst

If I try to install some other workload (eg maui or maui-windows) I get an error stating

Unable to download manifest microsoft.net.workload.emscripten: microsoft.net.workload.emscripten.manifest-6.0.200 has not been found on NuGet feeds https://api.nuget.org/v3/index.json, C:\Program Files (x86)\Microsoft SDKs\NuGetPackages"

I've also tried to completely remove and reinstall VS2022, without any luck.
I've then tried to run maui-check but when it tries to download Recommendation: Download .NET SDK (6.0.200) the exe is not valid and the task fails.

Worst part: I tried to install a fresh VS2022 preview on a different pc and everything works flawlessly... but I need it to work on my developmente pc!

.

Marco
  • 56,740
  • 14
  • 129
  • 152

1 Answers1

0

Sometimes cleaning Visual Studio cache helps to solve such issues.

Follow these steps:


Step 1: Clearing component cache and temp files

1.1 Close Visual Studio and make sure devenv process is not present in Task Manager (Details tab)

1.2 Delete folder %USERPROFILE%\AppData\Local\Microsoft\VisualStudio\17.0\ComponentModelCache

Note, that instead of 17.0 in the path it can be another version number, relevant to the installed Visual Studio.

1.3 Delete contents of the folder %USERPROFILE%\AppData\Local\Temp

1.4 Launch Visual Studio and check.

If it did not help. Going to step 2.


Step 2: Deleting Visual Studio cache folders

2.1 Close Visual Studio and make sure devenv process is not present in Task Manager (Details tab)

2.2 Delete these folders:

%USERPROFILE%\AppData\Local\Microsoft\Team Foundation
%USERPROFILE%\AppData\Local\Microsoft\VisualStudio
%USERPROFILE%\AppData\Local\Microsoft\VSCommon

2.3 Launch Visual Studio and check

Rafael
  • 1,281
  • 2
  • 10
  • 35