There is an unsaved comment in progress. You will lose your changes if you continue. Are you sure you want to reopen the work item?

1

Closed

Ambiguous Portable Libraries Should Prompt User

description

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.

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.

file attachments

No files are attached

Closed Jan 3, 2013 at 9:32 PM
by

We absolutely don't want to prompt as this would end up creating a bad general case NuGet experience for the sake of what appears to be a single package (Newtonsoft.Json). As such, we're closing the issue.

I think the perspective from the PCL team is that platform-specific versions of a library in a package should be compatible with the portable versions. So in the example above it would be fine to reference the net45 library from the the WPF project. The
net45 version might have additional functionality over the portable version, but it wouldn't have anything missing, and something compiled against the portable version should work with the net45 version.

To me, this seems like an extension of how this should work for different versions of a platform. IE it's really the same situation as if you had a package with net40 and net45 libraries, a net40 library referencing the package, and a net45 WPF app referencing
the net40 library and the package. NuGet would pick the net45 library for the app and it should be expected that it would work.

Json.NET unfortunately has an issue where the WP7 version isn't compatible with the portable version. This is because the portable version is signed with a strong name, but the WP7 version isn't. So it might be good to have a way to override the logic, but
that should be the exception rather than the rule.

Yes, I agree with Daniel, this would cause NuGet to start prompting for
all of our packages (Microsoft.Bcl, Microsoft.Bcl.Async, Microsoft.Composition, Microsoft.Tpl.Dataflow, Microsoft.Bcl.Immutable + a few more in the works) - even though it does exactly what we expect and want today.

To play nicely multiple platforms, portable libraries should be API compatible with their platform-specific versions. ie I should be able to take a library built against the portable Json.NET, and run it on the desktop using the desktop version of
Json.NET. If that doesn't work today, then I would consider it a bug on that library.

You don't want to have users to have to pick between using "portable" JSON.NET or using any extra functionality available in desktop JSON.NET. That's treating portable as a
separate platform, not as as the platforms itself and is not a good user experience.