maui: Unable to build a project with net7 RC 1
Description
Upgraded to newest VS Preview with support for maui .net 7 RC 1, but I´m unable to build the project. The output complains that workloads for IOS and MacCatalyst are missing. I repaired both, .net 7 RC1 SDK and VS but it had no effect.
Output of dotnet workload list:
Installierte Workload-ID Manifestversion Installationsquelle
-----------------------------------------------------------------------------------
maui-windows 7.0.0-rc.1.6683/7.0.100-rc.1 VS 17.4.32916.344
maui-maccatalyst 7.0.0-rc.1.6683/7.0.100-rc.1 VS 17.4.32916.344
maccatalyst 15.4.1006-rc.1/7.0.100-rc.1 VS 17.4.32916.344
maui-ios 7.0.0-rc.1.6683/7.0.100-rc.1 VS 17.4.32916.344
ios 15.4.1006-rc.1/7.0.100-rc.1 VS 17.4.32916.344
maui-android 7.0.0-rc.1.6683/7.0.100-rc.1 VS 17.4.32916.344
android 33.0.0-rc.1.151/7.0.100-rc.1 VS 17.4.32916.344
Output VS Error View
Severity Code Description Project File Line Suppression State
Error NU1012 Platform version is not present for one or more target frameworks, even though they have specified a platform: net7.0-ios, net7.0-maccatalyst MauiApp11 C:\src\stuff\MauiApp11\MauiApp11.csproj 1
Error NU1012 Platform version is not present for one or more target frameworks, even though they have specified a platform: net7.0-ios, net7.0-maccatalyst MauiApp11 C:\src\stuff\MauiApp11\MauiApp11.csproj 1
Error NETSDK1147 To build this project, the following workloads must be installed: maccatalyst
To install these workloads, run the following command: dotnet workload restore MauiApp11 C:\Program Files\dotnet\sdk\7.0.100-rc.1.22431.12\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets 38
Output dotnet workload restore
PS C:\src\stuff\MauiApp11> dotnet workload restore
Installing workloads: ios maccatalyst
Downloading Microsoft.iOS.Sdk.Msi.x64 (15.4.1006-rc.1)
Workload installation failed. Rolling back installed packs...
Downloading microsoft.net.sdk.tvos.manifest-7.0.100-rc.1.msi.x64 (15.4.1006-rc.1)
Installation rollback failed: One or more errors occurred. (microsoft.net.sdk.tvos.manifest-7.0.100-rc.1.msi.x64::15.4.1006-rc.1 is not found in NuGet feeds https://api.nuget.org/v3/index.json;C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\;https://kreon.halvotec.local/Collection1/_packaging/HalvotecPackages/nuget/v3/index.json".)
Downloading microsoft.net.sdk.maccatalyst.manifest-7.0.100-rc.1.msi.x64 (15.4.1006-rc.1)
Installation rollback failed: One or more errors occurred. (microsoft.net.sdk.maccatalyst.manifest-7.0.100-rc.1.msi.x64::15.4.1006-rc.1 is not found in NuGet feeds https://api.nuget.org/v3/index.json;C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\;https://kreon.halvotec.local/Collection1/_packaging/HalvotecPackages/nuget/v3/index.json".)
Downloading microsoft.net.sdk.ios.manifest-7.0.100-rc.1.msi.x64 (15.4.1006-rc.1)
Installation rollback failed: One or more errors occurred. (microsoft.net.sdk.ios.manifest-7.0.100-rc.1.msi.x64::15.4.1006-rc.1 is not found in NuGet feeds https://api.nuget.org/v3/index.json;C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\;https://kreon.halvotec.local/Collection1/_packaging/HalvotecPackages/nuget/v3/index.json".)
Workload installation failed: One or more errors occurred. (microsoft.ios.sdk.msi.x64::15.4.1006-rc.1 is not found in NuGet feeds https://api.nuget.org/v3/index.json;C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\;https://kreon.halvotec.local/Collection1/_packaging/HalvotecPackages/nuget/v3/index.json".)PS C:\src\stuff\MauiApp11>
Steps to Reproduce
- Update to newest VS preview
- Create a new maui project
- Build
- => Errors in Error View
Link to public reproduction project repository
why? dotnet new maui
Version with bug
Unknown/Other (please specify)
Last version that worked well
Unknown/Other
Affected platforms
iOS, macOS
Affected platform versions
doesn´t matter
Did you find any workaround?
no
Relevant log output
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 7
- Comments: 39 (6 by maintainers)
We are actively investigating this issue and have an idea of the problem - basically the version generated for the .msi installer created for the packages was creating an older version than the dotnet CLI tools expect to see.
We are working on this and will be publishing updated packages to make a workaround available as quickly as we can.
Thid is still not solved
I’ve been struggling this for the past few days, but I persevered after reading some of the comments here. I got it fixed in the end, but there are clearly some bugs to be ironed out with the overall process.
Here is what I experienced: If you have the .Net 7 RC1 SDK installed, and then you install Visual Studio 17.4.0 Preview 2.1 -
dotnet workload listwould look something like this (note the ugly error):In the scenario above, it seems to be necesary to manually uninstall ios, maccatalyst and macos workloads like so:
Once done, you can install using the command posted by @Redth earlier (with the skip signature flag enabled:
After doing this I was able to build.
Additionally - in case it helps anyone else - I did find strange behaviour when attempting to install Visual Studio 17.4.0 Preview 2.1 without having .Net 7 RC1 installed beforehand.
In this scenario, I found that “maui” would not appear in my workload list during
dotnet workload search- even when I had the “MAUI” workload checked in the VS installer.As a result, atempting to use the suggeted fix above would not work and would display “Workload id maui is not recognized”.
Using the “Repair” tool in the Visual Studio Installer was necessary to make the “maui” workload appear. It is odd that this would be required for a ‘fresh’ install - but that was my experience.
@virzak It doesn’t seem to help me…
We have some newer packages we will publish soon after a bit more validation.
If anyone is willing to try and install them from the staging feed, you can try the following commands:
Make sure you are running dotnet commands within the context of
7.0.100-rc.1(ideally the exact version is7.0.100-rc.1.22431.12)Run the following command exactly:
If you try this, please report your results!
ow. Well didn’t work out that way. Now, Visual Studio does not recognize my .NET MAUI project anymore and suggests installing extra components for a full development experience instead. However, when trying to do so, it also explains that everything is already in place.
Result: My .NET MAUI setup is completely broken… 😦
Can report the same, Vs 2022 is now broken too on my machine with maui 6.
What is worse, VS Preview 2.1 with installed RC1 does not allow to build 6.0 MAUI applications. I see constant error in MAUI build:
Error NETSDK1147 To build this project, the following workloads must be installed: maccatalyst To install these workloads, run the following command: dotnet workload restore SCF C:\Program Files\dotnet\sdk\6.0.401\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets 38
Error NU1012 Platform version is not present for one or more target frameworks, even though they have specified a platform: net6.0-ios, net6.0-maccatalyst
Have you ever tried VS 2022 and VS 2022 Preview installed together with both 6.0/7.0 RC1?
+1