When referencing a package that contains a portable library, such as "portable-windows8+net45", and an ambiguous non-portable library, such as "net45", the user should be prompted as to which library they want to reference.
USE CASE:
A related work item (https://nuget.codeplex.com/workitem/2790) states that it should be up to the package developer to choose a preference, but that won't work in the following scenario because the correct choice is only known by the user, similarly to the discussion: https://nuget.codeplex.com/discussions/398564.
1. User adds a new portable class library project to their solution.
2. User adds a reference to a NuGet package that contains a "portable-windows8+net45" library and a "net45" library. A reference to the portable library is added automatically by NuGet.
3. User adds a WPF project to their solution.
4. User adds a reference from their WPF project to their portable class library project.
5. User adds a reference in their WPF project to the previous NuGet package, only this time NuGet automatically chooses the "net45" library based on the rules defined in http://docs.nuget.org/docs/release-notes/nuget-2.1.
Given the choice, the package author is most likely going to give the "net45" library preference because it has a larger surface area, but clearly that's incorrect in this situation. The user needs to have the choice.
Comments: Or perhaps there's a way to automate it so that NuGet can make a better decision based on project references. Though perhaps the easiest and safest solution would be to give the user a choice.
USE CASE:
A related work item (https://nuget.codeplex.com/workitem/2790) states that it should be up to the package developer to choose a preference, but that won't work in the following scenario because the correct choice is only known by the user, similarly to the discussion: https://nuget.codeplex.com/discussions/398564.
1. User adds a new portable class library project to their solution.
2. User adds a reference to a NuGet package that contains a "portable-windows8+net45" library and a "net45" library. A reference to the portable library is added automatically by NuGet.
3. User adds a WPF project to their solution.
4. User adds a reference from their WPF project to their portable class library project.
5. User adds a reference in their WPF project to the previous NuGet package, only this time NuGet automatically chooses the "net45" library based on the rules defined in http://docs.nuget.org/docs/release-notes/nuget-2.1.
Given the choice, the package author is most likely going to give the "net45" library preference because it has a larger surface area, but clearly that's incorrect in this situation. The user needs to have the choice.
Comments: Or perhaps there's a way to automate it so that NuGet can make a better decision based on project references. Though perhaps the easiest and safest solution would be to give the user a choice.