Issue
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.
Solution
You could specify the name and version of the package in .csproj
file and set the certain platform with property Condition
.
For example
- If you just want to add the package to single platform
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" Condition="'$(TargetFramework)' == 'net6.0-ios'" />
</ItemGroup>
- If you want to add the package to multiple platforms
<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 .
Answered By - ColeX
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.