I am creating a MAUI project that supporting iOS and Android platforms.
The .csproj of project need to distinguish iOS and Android when using different
type of source.
There is a shared way from official document that Configure filename-based multi-targeting, such as including iOS files/folders as follows:
<ItemGroup Condition="$(TargetFramework.StartsWith('net8.0-ios')) != true">
...
<BundleResource Include="Resource*.png" />
</ItemGroup>
However, there is an another way to include iOS files/folders as follows:
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0-ios'">
...
<MauiImage Include="Resource*.png" />
</ItemGroup>
The effect of them is different, the first method will crash but the second will not.
I can not understand this. If someone has more information between using them, that will be much appreciated.