This is part of my Azure Pipeline:
- task: Bash@3
displayName: Install MAUI
inputs:
targetType: 'inline'
script: |
dotnet workload update
dotnet workload install maui android ios wasm-tools --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json --source https://api.nuget.org/v3/index.json
- task: Bash@3
displayName: Nuget Restorations
inputs:
targetType: 'inline'
script: |
dotnet restore $(app-name).sln --runtime ios-arm64 -p:TargetFramework=net9.0-ios \
--source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json \
--source https://api.nuget.org/v3/index.json
- script: |
dotnet publish -f net9.0-ios -c Release -r ios-arm64 --no-restore \
-p:PlatformTarget=arm64 \
-p:CodesignKey="$(identity)" \
-p:CodesignProvision="$(profile-name)" \
-p:ApplicationVersion="$(build-number64)" \
-p:CodesignTeamId="$(team)" \
-p:OutputPath=$(Build.ArtifactStagingDirectory)/publish \
displayName: 'Build & Publish iOS'
This is part of my .csproj
file:
<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' And '$(Configuration)' == 'Release'">
<ApplicationId>******</ApplicationId>
<PlatformTarget>arm64</PlatformTarget>
<SupportedOrientations>Portrait</SupportedOrientations>
<BuildIpa>False</BuildIpa>
<IpaIncludeArtwork>True</IpaIncludeArtwork>
<IpaPackageName>*****</IpaPackageName>
<CodesignEntitlements>Platforms\iOS\Entitlements.plist</CodesignEntitlements>
<CodesignKey>*****</CodesignKey>
<CodesignProvision>*****</CodesignProvision>
<EnableAssemblyILStripping>False</EnableAssemblyILStripping>
<MtouchDebug>False</MtouchDebug>
<MtouchLink>None</MtouchLink>
<MtouchUseLlvm>False</MtouchUseLlvm>
<MtouchExtraArgs>--none</MtouchExtraArgs>
<MtouchInterpreter>False</MtouchInterpreter>
<RunAOTCompilation>False</RunAOTCompilation>
<Optimize>False</Optimize>
<IsTrimmable>False</IsTrimmable>
</PropertyGroup>
If I set PublishTrimmed
to True
Or leave it Empty even with 'MtouchLink=None'
It will cancel the job:
Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
Optimizing assemblies for size. This process might take a while.
##[error]The Operation will be canceled. The next steps may not contain expected logs.
##[error]The operation was canceled.
Because of this error:
The job running on agent Hosted Agent ran longer than the maximum time of 60 minutes. For more information, see https://go.microsoft.com/fwlink/?linkid=207713420250702.3| |
The Operation will be canceled. The next steps may not contain expected logs.Build & Publish iOS |
The Operation will be canceled. The next steps may not contain expected logs.Build & Publish iOS |
The operation was canceled. Build & Publish iOS |
Or if I set it to False
It will give me this error:
error : iOS projects must build with PublishTrimmed=true. Current value: False. Set 'MtouchLink=None' instead to disable trimming for all assemblies. rk=net9.0-ios]
##[error]Bash exited with code '1'. ts(3
06,3):
What should I do exactly?!