There are significant differences compared to Xamarin and I couldn't find docs or even a discussion about the matter, and I am interested in knowing. It was pretty straight forward in Xamarin. If I wanted a nuget package for the android project and not the whole solution I could do that, but now it's just one project.
You could specify the name and version of the package in .csproj file and set the certain platform with property Condition .
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" Condition="'$(TargetFramework)' == 'net6.0-ios'" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" Condition="'$(TargetFramework)' == 'net6.0-ios' or '$(TargetFramework)' == 'net6.0-android'" />
</ItemGroup>
PS : Firstly make sure the package support net6.0 and net6.0 - xx before you add the package .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With