jamesmontemagno / Xamarin-Templates

Xamarin.Android Templates Pack
130 stars 105 forks source link

PackageReference warning on Microsoft.NETCore.UniversalWindowsPlatform #24

Closed marcominerva closed 5 years ago

marcominerva commented 6 years ago

With the latest version of the Plugin Template (5.2.0), there is a compilation warning:

A PackageReference for 'Microsoft.NETCore.UniversalWindowsPlatform' was included in your project. This package is implicitly referenced by the .NET SDK and you do not typically need to reference it from your project.

So the following line:

<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.1.5" />

Should be removed from the CSPROJ file.

jamesmontemagno commented 6 years ago

interesting.... is this not needed anymore?

What about for essentials? https://github.com/xamarin/Essentials/blob/master/Xamarin.Essentials/Xamarin.Essentials.csproj#L71

I will update this next week as I had some github issues yesterday and couldn't push code.

marcominerva commented 6 years ago

It depends on @onovotny's MSBuild.Sdk.Extras (used as Project Sdk): https://github.com/onovotny/MSBuildSdkExtras/blob/master/Source/MSBuild.Sdk.Extras/DefaultItems/ImplicitPackages.targets#L22

This doesn't happen with Xamarin.Essentials as it uses Microsoft.NET.Sdk as Project Sdk.

clairernovotny commented 6 years ago

As an SDK reference, we can add additional nuget package references from there; that's not possible when used as a package reference. That's one reason for the difference.

Another is that the UWP reference should be defined as private and not included as a dependency on the generated nuget. The set of reference assemblies in there from a library perspective doesn't change; what does change are the .NET Native compiler bits. That's only relevant to apps. This helps prevent pain of package compatibility warnings too.

jamesmontemagno commented 6 years ago

Ahhhhhhh i see, very interesting! Makes sense. I didn't realize it added it for me automatically.

marcominerva commented 5 years ago

Hi @jamesmontemagno! Any updates on this? :-)

jamesmontemagno commented 5 years ago

Yup, just setting up a CI cycle on this... wonder if i can ship directly to the marketplace or not