skip to Main Content

Using VS for Mac 17.4.5

  1. Generate new generic Maui App, called MAUI1. Disable Mac Catalyst build and Android build, solely an IOS problem

  2. Visual Studio sets initial Target iOS version to 16.1, Minimum iOS version to 11.0

  3. Build and run app, on an iPad connected to the Mac, running iOS 16.3. Runs fine. Deployment target is info.plist is blank.

  4. In Project — Properties box, change Target ios version from 16.1 to 15.0. Click OK. Output window says Packages Successfully restored.

  5. 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)

  6. Can’t get it to build. I restore packages, clean project, rebuild all, even delete bin and obj folders. No dice.

  7. 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.

  8. 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


  1. If you want to change back to 16.1, you may change the TargetFrameworks in .csproj file.

    <TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
    

    And if you want to build for iOS15, you may try downgrade to XCode13.

    Hope it works for you.

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search