Create an iOS app extension (set <IsAppExtension>true</IsAppExtension>).
Add an owning app that loads the app extension.
Build.
Expected Behavior
Build completes ok.
Actual Behavior
Receive a linker error:
ILLink : error IL1034: Root assembly 'Dotnet.Test.NetExtension, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have entry point. [/Volumes/External/git/fabric-test/src/Dotnet.Test.NetExtension/Dotnet.Test.NetExtension.csproj::TargetFramework=net8.0-ios]
/Users/alistairevans/.nuget/packages/microsoft.net.illink.tasks/8.0.0-rc.1.23419.4/build/Microsoft.NET.ILLink.targets(87,5): error NETSDK1144: Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false. [/Volumes/External/git/fabric-test/src/Dotnet.Test.NetExtension/Dotnet.Test.NetExtension.csproj::TargetFramework=net8.0-ios]
I have to add the following Target to the extension project file to make it work:
Only building from the command-line right now (no VS on this Mac); as much version information as possible attached.
Version information
```
dotnet version
8.0.100-rc.1.23463.5
dotnet workload list
Installed Workload Id Manifest Version Installation Source
--------------------------------------------------------------------------------
maui-maccatalyst 8.0.0-rc.1.9171/8.0.100-rc.1 SDK 8.0.100-rc.1
maui-ios 8.0.0-rc.1.9171/8.0.100-rc.1 SDK 8.0.100-rc.1
installed packages:
```
Steps to Reproduce
<IsAppExtension>true</IsAppExtension>
).Expected Behavior
Build completes ok.
Actual Behavior
Receive a linker error:
I have to add the following Target to the extension project file to make it work:
This was inspired by what I think is a related issue: https://github.com/dotnet/linker/issues/3165
Environment
Only building from the command-line right now (no VS on this Mac); as much version information as possible attached.
Version information
``` dotnet version 8.0.100-rc.1.23463.5 dotnet workload list Installed Workload Id Manifest Version Installation Source -------------------------------------------------------------------------------- maui-maccatalyst 8.0.0-rc.1.9171/8.0.100-rc.1 SDK 8.0.100-rc.1 maui-ios 8.0.0-rc.1.9171/8.0.100-rc.1 SDK 8.0.100-rc.1 installed packages:Build Logs
msbuild.binlog.zip
Example Project
Example project where this failure occurs is here: https://github.com/enclave-alistair/dotnet-ios-netextension/tree/without-trimming-workaround
Workaround is applied on
main
of that repo, thewithout-trimming-workaround
branch fails to build.