jamesmontemagno / SettingsPlugin

Read and Write Settings Plugin for Xamarin and Windows
MIT License
324 stars 80 forks source link

Package Config to Package Reference migration warning in Xamarin.MAC #142

Closed rafsanulhasan closed 5 years ago

rafsanulhasan commented 5 years ago

Hi @jamesmontemagno, I found this plugin very useful. But I'm having an issue with NuGet packages while I was trying to migrate my Xamarin.MAC project from packages config to package reference. I know this might not be the right place to post but I want a help from you because only for this package the migration process showed the warning. Please let me explain step by step what I did from the scratch and what's the issue that can help you find out what erroneous did I do with my project.

Steps

  1. Created a Xamarin.Forms project using VS 2017 build 15.9.3 (using .NET Standard as a shared project)
  2. Added some more platforms like tvOS, watchOS, GTK, WPF and MACOS (using VS for MAC)
  3. Committed the project to GitHub to get the solution in my Windows PC.
  4. Installed some cross platform libraries that developed with PCL including Cross Connectivity, Cross Settings, SkiaSharp and so on (from windows in VS 2017).
  5. Installed Prism and Unity to loosely couple components and get better Navigation & DI.
  6. Migrated all the projects from PC to PR.

Result

Every thing worked fine in all the projects (installation of NuGet packages).
The Xamarin.MAC projects might not be migrated correctly as it shows up a warning that: "content" assets did not load correctly"

But after restarting VS, I got everything working, all the NuGet packages installed correctly. But while I was like editing the MACOS project, I found it shows error in the project file such that

"ItemGroup does not include a Version"

<ItemGroup>
     <PackageReference Include="Xam.Plugins.Forms" >
              <Version>3.1.1</Version>
     </PackageReference>
</ItemGroup>

I tried these solutions:

<ItemGroup>
     <PackageReference Include="Xam.Plugins.Forms" Version="3.1.1" PrivateAssets="All"/>
</ItemGroup>

And

<ItemGroup>
     <PackageReference Include="Xam.Plugins.Forms" PrivateAssets="All">
              <Version>3.1.1</Version>
     </PackageReference>
</ItemGroup>

Neither of them worked. the first solution I tried fixes the error but introduces a new error "Private Assets not found in ItemGroup"

My questions are:

  1. It might me showing an error in windows but would it work on a MAC?
  2. Does VS for MAC support PR type of project?
  3. Should I ignore or overlook the warning on windows?

Please address any kind of incompatibility issue.

Thanks in advance for you co-operation despite posting the issue on the wrong place.

jamesmontemagno commented 5 years ago

Trying the 4.0.0.10-beta should work just fine.

Besides that, you can just ignore it.

rafsanulhasan commented 5 years ago

Great! Thanks