Portable Library Tools Support

Topics: General
Aug 11, 2012 at 12:05 PM

Hello,

with the closer drawing release of .NET 4.5 and Visual Studio 2012 in the next week, I wonder how is the support for the portable library tools going on?

Developer
Aug 11, 2012 at 4:26 PM

We are starting to look into it. Unfortunately, it won't be available in the version 2.0 that will come with VS 2012.

Aug 11, 2012 at 4:35 PM

That's a pity.. Especially since the Portable Library Tools are already available for more than a year.

But I'm glad that you're already starting. Any estimated schedule on this?

Aug 23, 2012 at 2:16 PM

Any news on this?

Developer
Aug 24, 2012 at 8:17 AM

I'm working on it. It may go into the 2.1 release, but we're not 100% sure yet.

Aug 24, 2012 at 3:13 PM

Glad to hear. I'm really looking forward to this and hoping it will be part of 2.1! Only portable library tools support is missing, before I start using NuGet for our company libraries.

Developer
Aug 24, 2012 at 5:11 PM

To help us better understand your need, can you describe what you are looking for in the portable library support? What you are trying to achieve with your NuGet packages?

Aug 25, 2012 at 7:53 PM

We work on a lot of different programs, and for all of them we created common helper and core projects, providing core and helping functionality for our programs. We have these projects for Portable, .NET and Silverlight projects. Now when we extend one of these projects it easily gets confusing and messy to upgrade the used assemblies in our programs.

So I thought it would be nice wrap these helper and core assemblies into private NuGet packages, simply running an update-command whereever needed. I'd even go so far to immediately create and publish a new package on TFS checkin. Using only seperate .NET and Silverlight packages is not an option, because in our main projects we also use portable projects to share code and data-objects with .NET (web service) and Silverlight.

So what I'm missing in nuget is the possibility to create nuget packages from Portable projects, and install these packages to other portable projects. Not sure whether the second works already (I didn't test), as I failed with the first task already.

I believe this can be rather difficult with the many different combinations you can have in portable projects. Perhaps an option would be to start with the lowest shared subset for the most common used platforms (.NET, Silverlight, WP).

Developer
Aug 26, 2012 at 11:23 AM

I have good news for you. Portable library support will go into 2.1, which is slated to be released in late September.

And it will support both of your tasks, meaning a package containing portable assemblies can be installed into a portable project, as well as a normal project if the project is supported by the portable assemblies.

Aug 26, 2012 at 11:43 AM

Yay! :) Glad to hear! Now I just gotta wait a month.. but this news motivates me to start packaging the not portable projects.

Developer
Aug 28, 2012 at 5:40 PM

I've just checked in the changeset to support Portable libraries. Do you want to be our guinea pig and try it out to see if it meets your needs?

You can download our nightly build VSIX here. (Note that you need to uninstall the official signed VSIX first)

http://ci.nuget.org:8080/guestAuth/repository/download/bt4/.lastSuccessful/VisualStudioAddIn/NuGet.Tools.vsix

Aug 28, 2012 at 9:04 PM
Edited Aug 28, 2012 at 9:11 PM

Unfortunately there's a lot of work coming at me this week, and a nagging second half in my spare time. :) Hopefully I can take a look at it in the weekend.

Sep 3, 2012 at 9:19 PM

I was thinking of testing out the new PCL support but I had a few questions first.  #1 how does this affect nuget pack command?  Is their a new pcl folder or something different?

Also how does this work with two projects that have an incompatible set of supported runtimes selected?  Say I have PCL library A that as part of it's targets, targets the Xbox 360 but then I have PCL library B that only targets .NET 4.5 apps and windows store apps.  Now I try to add a nuget reference to project B from project A.  I'm assuming this will not be allowed.

Now for a slightly more complicated situation.  Say I have two versions of project A both portable libraries.  One includes support for Xbox 360 and one does not.  So Project A with 360 support, and Project A without 360 support.   Can these be packed together in one package or can a package just have a single pcl version? IF they can be packaged together when adding a reference how will nuget choose which one to select?

Thanks.

Developer
Sep 4, 2012 at 3:20 PM

Yup, sorry I didn't provide those information. When 2.1 is near shipping, we'll make sure to update our documentation on docs.nuget.org.

Here are enough details to get you going though.

To set a target framework for PCL, name your folder in this format:

portable-<list of supported frameworks separated by + sign>

For example:

portable-sl4+net45+wp7 : this supports Silverlight4, .NET 4.5 and Windows Phone 7

(Note that in the current build, we haven't supported Xbox yet. We are considering adding it.)

For your first scenario, you're right. The package will not be installed into the project.

For the second scenario, you can include both versions in one package. Just use the folder format as described above, one with Xbox and one without. However, as I said, NuGet doesn't recognize the Xbox moniker yet, so the folder will be treated as invalid.

Sep 10, 2012 at 5:24 AM

I'm not that experienced in creating nuget packages yet.. But is it right that I can't create packages with the Visual Studio Extension, and need the command line program? If I'm wrong, please explain (and extend the docs) how to do it using the extensions. Else please suply a link to the nightly build for the command line program. :)

Developer
Sep 11, 2012 at 2:56 AM

You're right. You can't create packages inside VS. You'll need to use the command line program or the great tool NuGet Package Explorer.