1
votes

I am trying to create a Nuget Package for another project, which has the following targets set in the project properties:

  • .NET Framework 4.5
  • ASP.NET Core 1.0
  • Windows 8
  • Windows Phone Silverlight 8
  • Xamarin.Android
  • Xamarin.iOS
  • Xamarin.iOS (Classic)

The project I create the package from is targeting exactly the same.

In the Nuget Package Explorer I created a lib folder and in that lib-Folder I added another folder with Add Portable Library and the following settings:

  • .NET Framework v4.5 and higher
  • Windows Phone 8

The directory name after creation is:

portable-net45+wp8 (.NETPortable,Version=v0.0,Profile=net45+wp8)

I published the Nuget Package to my private repository and tried to import it into my project I described above, but it is giving me an error:

Could not install package 'my.package 0.0.1-alpha1'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile78', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

Can anyone tell me, how to set my package up correctly, so my package can be imported? What is wrong?

Thanks in advance!

1

1 Answers

0
votes

Your NuGet package has the portable profile:

portable-net45+wp8

Profile 78 has the portable profile:

portable-net45+win8+wp8

So the problem is that the profile you are using does not indicate that it supports Windows 8 (win8) so NuGet believes it is not compatible with Profile 78.

If your portable class library assembly targets Profile 78 then it should be OK for you to rename that directory to include win8 so it becomes portable-net45+win8+wp8