maui: Error - selected execution mode not supported in MAUI

This issue has been moved from a ticket on Developer Community.


[severity:I’m unable to use this version] I cannot run a MAUI app in Visual Studio Enterprise 2022 for Mac Preview Version 17.3 Preview (17.3 build 1972).

The error: Can not execute “path to project/project.dll”. The selected execution mode is not supported for .NET projects.

I tried to check via Terminal: maui-check, and there I got the following error:

.NET SDK - Workloads (6.0.301) Checkup… ❌ android (Microsoft.NET.Sdk.Android.Manifest-6.0.300 : 32.0.424) not installed. ❌ maui (Microsoft.NET.Sdk.Maui.Manifest-6.0.300 : 6.0.408) not installed.

I tried the automatic fix and I got the following error: Fix failed - Workload Install failed: `dotnet workload install –from-rollback-file “/var/folders/nb/7pktfhcd5lq3q23rd4cmqby00000gn/T/maui-check-2c858791/workload.j son” android ios maccatalyst tvos macos maui --source “$(PACKAGE_SOURCE_NUGET_ORG)”


Original Comments

Feedback Bot on 7/19/2022, 07:32 PM:

(private comment, text removed)

Thomas Rothen on 7/19/2022, 10:59 PM:

(private comment, text removed)


Original Solutions

(no solutions)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 5
  • Comments: 19 (5 by maintainers)

Most upvoted comments

Even though My Mac is selected. android binaries are referred to when I click on run or press F5. Probably wrong platform binaries are selected.

image image

The “selected execution mode is not supported for .NET projects” error seems to happen if you do not have classic (legacy) Xamarin.iOS installed.

Visual Studio for Mac seems to disable the execution handlers for iOS and Maccatalyst in this case for MAUI. This results in the cryptic error message about the execution mode not being support.

If you create a standalone .NET 6 iOS or .NET 6 Maccatalyst project then the main toolbar shows a Hammer icon instead of the arrow icon, indicating the project cannot be run.

Re-running the installer and installing Legacy - Xamarin.iOS seems to be a workaround. After doing that I could run/debug MAUI and .NET 6 iOS/Maccatalyst projects.

+1 Stuck with the same issue.

As @Mteheran said, build works, but VS can’t run the app. So, at least I can run the app from the console with: dotnet build -t:Run -f net6.0-maccatalyst

@davidortinau @rmarinho Lots of people are going to come with same issue. Any resolution?

I had to install legacy Xamarin.Android to get hot reload and debugging to work on VS for Mac Preview 17.4.

I get the same thing for both debug and release.

Repro:

  1. Open Visual Studio for mac
  2. Create a new Maui app
  3. Press F5
  4. Observe error message about an Android dll not being supported on MacOS (three platforms in one bug!)

Here’s my project that has the problem.

Archive.zip

And system details

Visual Studio Community 2022 for Mac Preview
Version 17.3 Preview (17.3 build 2012)
Installation UUID: 2df1a690-b440-484a-98f9-6a22f2bfcb16

Runtime
.NET 6.0.5 (64-bit)
Architecture: Arm64

Roslyn (Language Service)
4.3.0-3.22312.2+52adfb8b2dc71ed4278debcf13960f2116868608

NuGet
Version: 6.2.1.2

.NET SDK (Arm64)
SDK: /usr/local/share/dotnet/sdk/6.0.400-preview.22330.6/Sdks
SDK Versions:
	6.0.400-preview.22330.6
	6.0.302
MSBuild SDKs: /Applications/Visual Studio (Preview).app/Contents/MonoBundle/MSBuild/Current/bin/Sdks

.NET SDK (x64)
SDK Version: 3.1.421

.NET Runtime (Arm64)
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	6.0.7
	6.0.6

.NET Runtime (x64)
Runtime: /usr/local/share/dotnet/x64/dotnet
Runtime Version: 3.1.27

Xamarin.Profiler
Version: 1.8.0.19
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Updater
Version: 11

Apple Developer Tools
Xcode 13.4.1 (20504)
Build 13F100

Xamarin.Mac
Version: 8.10.0.5 (Visual Studio Community)
Hash: 96b3edb6d
Branch: d17-2
Build date: 2022-05-18 07:32:06-0400

Xamarin.iOS
Xamarin.iOS not installed.
Can't find mtouch or the Version file at /Library/Frameworks/Xamarin.iOS.framework/Versions/Current.

Xamarin Designer
Version: 17.3.0.204
Hash: f5da0100a
Branch: remotes/origin/d17-3
Build date: 2022-07-14 20:16:42 UTC

Xamarin.Android
Not Installed

Microsoft Build of OpenJDK
Java SDK: /Library/Java/JavaVirtualMachines/microsoft-11.jdk
11.0.12
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Eclipse Temurin JDK
Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk
1.8.0.302
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Android SDK Manager
Version: 17.3.0.21
Hash: 91e34a0
Branch: remotes/origin/d17-3
Build date: 2022-07-14 20:16:47 UTC

Android Device Manager
Version: 0.0.0.1168
Hash: 4b9aaa3
Branch: 4b9aaa3
Build date: 2022-07-14 20:16:47 UTC

Build Information
Release ID: 1703002012
Git revision: f6bf6fa9b2a092abfd87672666c59e4ac2317b6c
Build date: 2022-07-14 20:14:11+00
Build branch: release-17.3
Build lane: release-17.3

Operating System
Mac OS X 12.4.0
Darwin 21.5.0 Darwin Kernel Version 21.5.0
    Tue Apr 26 21:08:29 PDT 2022
    root:xnu-8020.121.3~4/RELEASE_ARM64_T8101 arm64

Same error from past 1 week. Any resolution ???
Debug works fine. Release - > Error This is my prod app can’t share the repo. Screen Shot 2022-07-23 at 11 34 52 AM