Using VS for Mac 17.4.5
-
Generate new generic Maui App, called MAUI1. Disable Mac Catalyst build and Android build, solely an IOS problem
-
Visual Studio sets initial Target iOS version to 16.1, Minimum iOS version to 11.0
-
Build and run app, on an iPad connected to the Mac, running iOS 16.3. Runs fine. Deployment target is info.plist is blank.
-
In Project — Properties box, change Target ios version from 16.1 to 15.0. Click OK. Output window says Packages Successfully restored.
-
Build solution fails. Error message /usr/local/share/dotnet/sdk/7.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(5,5): Error NETSDK1005: Assets file ‘/Users/visualstudio/Desktop/MauiApp1/MauiApp1/obj/project.assets.json’ doesn’t have a target for ‘net7.0-ios15.0’. Ensure that restore has run and that you have included ‘net7.0-ios15.0’ in the TargetFrameworks for your project. (NETSDK1005) (MauiApp1)
-
Can’t get it to build. I restore packages, clean project, rebuild all, even delete bin and obj folders. No dice.
-
Now restore target iOS version to 16.1.Can’t build. Similar error: /usr/local/share/dotnet/sdk/7.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(5,5): Error NETSDK1005: Assets file ‘/Users/visualstudio/Desktop/MauiApp1/MauiApp1/obj/project.assets.json’ doesn’t have a target for ‘net7.0-ios16.1’. Ensure that restore has run and that you have included ‘net7.0-ios16.1’ in the TargetFrameworks for your project. (NETSDK1005) (MauiApp1). Again, none of the usual clearing out tricks work. The first change broke it, but undoing that change doesn’t restore it.
-
Sample code online at https://drive.google.com/file/d/1d2036OIxidwMTWUCJyqzebKM0t7cJ5IJ/view?usp=share_link Any ideas? Tx
Trying to build a MAUI app on VS Mac for iOS 15
2
Answers
If you want to change back to 16.1, you may change the TargetFrameworks in .csproj file.
And if you want to build for iOS15, you may try downgrade to XCode13.
Hope it works for you.
You have an error in your MauiApp1.csproj. Edit the file and search for "net7.0-ios16.1" and remove "16.1".
If you run the command : dotnet build -f net7.0-ios your solution builds just fine.