Error running MAUI on iOS Device

Jassim Al Rahma 1,546 Reputation points
2022-06-24T18:11:33.737+00:00

Hi,

I have just downloaded Visual Studio for Mac PRE 17.3 (Build 1038) but when I try to run the default MAUI app on iPhone device I get below error:

/usr/local/share/dotnet/sdk/6.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(5,5): Error NETSDK1047: Assets file '/Users/jassim/Projects/Wink/Wink/obj/project.assets.json' doesn't have a target for 'net6.0-ios/iossimulator-x64'. Ensure that restore has run and that you have included 'net6.0-ios' in the TargetFrameworks for your project. You may also need to include 'iossimulator-x64' in your project's RuntimeIdentifiers. (NETSDK1047) (Wink)

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,147 questions
{count} votes

2 answers

Sort by: Most helpful
  1. elamaunt 5 Reputation points
    2024-06-21T10:23:36.3933333+00:00

    There is a bug in Visual Studio for mac when you are switching a runtime.

    Call this command in Visual Studio's terminal for solution:

    dotnet restore --packages .nuget --runtime iossimulator-x64 
    
    1 person found this answer helpful.

  2. Bruce (SqlWork.com) 60,386 Reputation points
    2024-06-21T17:18:47.6366667+00:00

    you should be using visual studio for Mac build 17.6.12 (lastest from the stable channel).

    note: Visual Studio Mac supports ends 8/31/2024 and net 6 supports ends 11/12/2024. You should upgrade the project to net 8 and pick your replacement for Visual Studio.

    1 person found this answer helpful.
    0 comments No comments