Getting Azure Storage (blob) to work with Xamarin.Forms

Dave Voyles
Dave Voyles
Published in
2 min readJul 29, 2016

I recently started working on a Xamarin.Forms project, where I need to use Azure Blob Storage to host pictures taken from a mobile device’s camera. Along the way, I came across several great tutorials illustrating how to take advantage of blob storage, but they were all missing one key part: I couldn’t use this namespace:

Microsoft.WindowsAzure.Storage.Blob;

That storage namespace kept coming up missing. Bizarre, considering I knew I had the NuGet package installed. After 2 days of searching, I finally resolved it. Hopefully this help you. Let me know if you have an alternative means to get this to work.

Changing the profile & retargeting the PCL

After installing these NuGet packages, you actually need to change the profile on your Xamarin project. You can do this by going to the shared project -> Options -> General → C#

shared-project-pcl
  • Change the Current Profile to PCL 4.5 — Profile111
  • (I have no idea of what this does.)
  • You need to retarget your NuGet packages for this new profile now.
  • Right click on Packages within the shared project, and you’ll have 5 options here.
  • Retarget will be available. Click that. (Not shown here, as I’ve already retargeted)
shared-project-package
  • Rebuild your project

How I figured this out

I stumbled across this Xamarin forum post, where someone had the exact same issue. One user pointed us towards a bug report, where PCL references were not added automatically via NuGet package installation. They recommended retargeting, and it worked! Now I can include the using Microsoft.WindowsAzure.Storage.Blob; namespace.

Additional Resources

--

--

Dave Voyles
Dave Voyles

Tech Evangelist @ MSFT | Game Dev | Startups | VC | Programming