Windows Phone 8.1 NuGet packages with XAML components

As part of our multiple Auth0 SDKs, we have a NuGet package that provides consumers an easy way to display our Login Widget in Windows Phone applications.

Widget

With the release of Windows Phone 8.1 we received several requests asking for a new version of the package that supports the newly available Windows Phone 8.1 type of project, so we the first step was to update our library and sample projects in GitHub.

Having done that, I used the NuGet Package Explorer to update our package. Initially I added support our only dependency, Json.NET.

Dependencies

After that I added the Windows Phone 8.1 assembly to the required folder and tried the package out.

Initial Structure

Unfortunately I got a not very descriptive exception saying XAML parsing failed when the InitializeComponent method of our LoginPage.xaml was invoked. After some research and a short twitter conversation with @timheuer I found that I had to also manually include the following files that were part of the bin folder:

  • *.pri
  • *.xr.xml
  • *.xbf

I checked the *.pri file to find the relative path where the other two files were being looked for and ended up with the following structure.

Additional Components

One final adjustment I had to make was to manually change the targetFramework from WindowsPhoneAppx8.1 to WindowsPhoneApp8.1 (without the ‘x’) in the .nuspec file outside of NuGet Package Explorer, as it seems there is a small bug with the naming it provides.

Dependencies change