How to manage to build/deploy and debug .NET (8) iOS project with its extension project

Boleslav 0 Reputation points
2024-02-13T21:06:13.74+00:00

I am using Visual Studio (Windows). My solution includes two projects. (All .NET 8 with ios workload): <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>net8.0-ios</TargetFramework> First project is the iOS host app. (Not maui workload, but ios, jic). Second project is the iOS Extension project with this:
<IsAppExtension>True</IsAppExtension> <IsWatchExtension>False</IsWatchExtension> <PlatformTarget>ARM64</PlatformTarget> <MtouchDevice>iPhone</MtouchDevice> It's related in the the host app like this:
<ProjectReference Include="..\ext\ext.csproj"> <IsAppExtension>true</IsAppExtension> <IsWatchApp>false</IsWatchApp> </ProjectReference> The issue I can't make the project deployed and run debugging. After long tries and experiments I finally managed to build it without errors (because the extension project required explicitly setting up its PlatformTarged independently on the host app project). But now, I still get these errors:

Please select a valid device before running the application
(related to the extension project)
Xamarin.iOS does not support deploying the previous version. Please ensure your solution builds before deploying it.
(related to the host project) 4>Deploy failed ========== Build: 2 succeeded, 0 failed, 2 up-to-date, 0 skipped ========== ========== Build completed at 10:50 PM and took 01:32.718 minutes ========== ========== Deploy: 0 succeeded, 2 failed, 0 skipped ========== ========== Deploy completed at 10:50 PM and took 01:32.719 minutes ==========

When I set
<MtouchDevice>iPhone</MtouchDevice>
for the extension, it started mentioning "Signing error". When I set that explicitly for the extension project it still gives me such error. Also, as long as those the-new-.net-style way with workloads used, I can't select any CPU/Platform explicitly in the Configuration Manager, as having the only option "Any CPU" for the target project(s). So, I can't make the projects run debugging (not extension's nor even the host app)!

(jic, everything runs and deploys well when running "dotnet build" command line, except still not able to debug it) Any thoughts?

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,103 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
4,026 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.