PCL and .NET NuGet Libraries are now enabled for Xamarin

PCL and .NET NuGet Libraries are now enabled for Xamarin

Rate This
  • Comments 25

Earlier today, Soma announced a collaboration between Microsoft and Xamarin. As you probably know, Xamarin’s Visual Studio extension enables developers to use VS and .NET to extend the reach of their apps across multiple devices, including iOS and Android. As part of that collaboration, today, we are announcing two releases around the .NET portable class libraries (PCLs) that support this collaboration:

Microsoft .NET NuGet Libraries Released

Today we released the following portable libraries with our new license, on NuGet.org:

You can now start using these libraries with Xamarin tools, either directly or as the dependencies of portable libraries that you reference.

We also took the opportunity to apply the same license to Microsoft .NET NuGet libraries, which aren’t fully portable today, like Entity Framework and all of the Microsoft AspNet packages. These libraries target the full .NET Framework, so they’re not intended to be used with Xamarin’s iOS and Android tools (just like they don’t target Windows Phone or Windows Store).

These releases will enable significantly more use of these common libraries across Windows and non-Windows platforms, including in open source projects.

Cross-platform app developers can now use PCL

Portable class libraries are a great option for app developers building for Microsoft platforms in Visual clip_image001Studio, to share key business functionality across Microsoft platforms. Many developers use the PCL technology today, for example, to share app logic across Windows Store and Windows Phone. Today’s announcement enables developers using Xamarin’s tools to share these libraries as well.

In Visual Studio, you’ll continue to use Portable Class Library projects but will be able to reference them from within Xamarin’s tools for VS. That means that you can write rich cross-platform libraries and take advantage of them from all of your .NET apps.

The following image demonstrates an example set of .NET NuGet library references that you can use within one of your portable libraries. The .NET NuGet libraries will enable new scenarios and great new libraries built on top of them.

You can build cross-platform libraries with .NET

This announcement also benefits .NET developers writing reusable and open source libraries. You’ve probably used some of these libraries, for example Json.NET. These developers have been very vocal about wanting this change. This announcement greatly benefits those library developers, enabling them to leverage our portable libraries in their libraries.

Getting started with portable libraries and Xamarin

You can start by building portable libraries in Visual Studio, as you can see in the screenshot above. You can take advantage of the portable libraries that we released today. Write code!

You’ll need an updated NuGet client, to take advantage of this new scenario. Make sure that you are using NuGet 2.7.2 or higher, or just download the latest NuGet for your VS version from the Installing NuGet page.

We are working closely with Xamarin to ensure that our NuGet libraries work well with Xamarin tools, as well as PCL generally. Please tell us if you find any issues. We’ll get them resolved and post them to our known issues page.

Thank You

Thank you for the feedback on UserVoice. With today’s announcement, we can mark the request to Remove the platform restriction on Microsoft NuGet packages as complete. Thanks to Phil Haack for filing the issue. Coupled with our collaboration with Xamarin, .NET developers have some compelling tools, especially for targeting mobile devices.

Both Microsoft and Xamarin want to see this scenario succeed. We’d love your feedback. Please tell us how the new features are working for you.

This post was written by Rich Lander, a Program Manager on the .NET Team.

Leave a Comment
  • Please add 6 and 8 and type the answer here:
  • Post
  • Pretty cool, thanks for this! Thumbs up!

  • This is great news!

  • Wow, I'm so excited about these announcements, this is a really big step forward for cross-platform .NET. While I expected you'd remove the Windows-only restriction for HttpClient, I'm positively surprised that you've done the same for EF and MVC - that is FANTASTIC! Keep up the good work!

  • Good news! good to hear PCL is offically for all platforms..

  • This is fantastic! Thank you so much!

    On the downside, I have so much new work to do to make many of my libraries PCL now. :P But it's a good problem to have (and not that much work, but it's funnier to imply it is).

  • Microsoft, developers, and clients all benefit when Microsoft listens. Excellent move.

  • Great news. Now, is PCL supported by Visual Studio Express yet?

  • Not only is this great news from a technical standpoint, but the call back to a widely-discussed issue on UserVoice, understanding it, closing it with a concrete action, and giving props to the people who championed it is a first-rate community relationship. I feel real closure and connection, which I really think is the first time it's happened with you, MS. Bravo.

  • Thanks a lot for the kind words!

    @Curt: We absolutely understand that PCL support in Visual Studio express editions is super important to many of our developers. That's why it's on our list. However, I can't promise that we actually end up delivering it in the VS 2013 time frame. As you've seen today, there is a lot of great stuff going on and resources are always more scarce than one would hope.

  • Visual Studio + Xamarin + PCL + MvvmCross = WP/Win8/Android/iOS with most of the code shared

    Awesome!

  • Great news! Thank you so much for this!

    I'm really looking forward to the ability for things like the Immutable Collections to be used in OSS libraries.

  • Xamarin is great but their pricing is insane! even with the MSDN discount. We're a tiny start-up development house that has benefited from the MS BizSpark programme and we simply cannot stretch to paying out a thousand bucks per platform, per year, per developer - mobile isn't even a revenue generator for us - it would merely be extending some functionality from our main apps to mobile and we'd give it to customers for free. I know they have a free & an indie edition blah blah blah but we wanna work in VS. The good news is that Xamarin will soon have a competitor in this space that could potentially blow them out of the water with full VS support and direct access to native APIs on each platform (iOS, Android & Mac) and their pricing will be less than 1/3rd of Xamarin's. I've been sworn to secrecy about it but expect to have a cost-effective Xamarin alternative before the end of the year. (No I don't work for the company, just got some info about it recently).

  • So happy about the move. Thank you microsoft!

  • Fantastic news & perfect timing as we have a Xamarin project kicking off next month!

  • I second the need for PCLs in Express editions. Otherwise your company's constant claims that the tooling for Windows 8 and Windows Phone development is free is pure hypocrisy.

Page 1 of 2 (25 items) 12