I'm currently writing an app which will target multiple platforms thanks to xamarin. The logic of the app in in a PCL and I'm using a WPF app as a frontend to test the PCL. I need to connect to my BLOB storage account which works perfectly from the WPF app with the following code which resides in the PCL :
bool connected = false;
int attempts = 0;
while (!connected)
{
try
{
Debug.WriteLine("CLIENT | Connecting to Storage try " + (attempts + 1).ToString());
// Retrieve storage account from connection string.
storageAccount = CloudStorageAccount.Parse(TechnicalData._BLOBCONNECTIONSTRING);
// Create the blob client.
blobClient = storageAccount.CreateCloudBlobClient();
// Retrieve a reference to a container.
blobContainer = blobClient.GetContainerReference(TechnicalData._BLOBCONTAINERFLIGHTLOGS);
// Create the container if it doesn't already exist.
blobContainer.CreateIfNotExists();
connected = true;
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
Debug.WriteLine(ex.InnerException);
Debug.WriteLine(ex.StackTrace);
attempts++;
connected = false;
}
}
However, when used from a WP8 app, the following error occurs :
CLIENT | Connecting to Storage try 21 A first chance exception of type 'System.IO.FileNotFoundException' occurred in Microsoft.WindowsAzure.Storage.DLL Could not load file or assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
at Microsoft.WindowsAzure.Storage.CloudStorageAccount.ParseImpl(String connectionString, CloudStorageAccount& accountInformation, Action`1 error) at Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse(String connectionString) at APXClient.PCL.AirproxClient.ConnectBlobStorage()
Help would be greatly appreciated !