问题
I'm using Visual Studio for Mac, when I follow this guild. https://docs.microsoft.com/en-us/azure/storage/blobs/storage-dotnet-how-to-use-blobs
With code:
// Parse the connection string and return a reference to the storage account.
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
CloudConfigurationManager.GetSetting("StorageConnectionString"));
I got this exception:
System.DllNotFoundException: fusion.dll
I try to do in Visual Studio on Window, it is no problem. It is a problem of Visual Studio for Mac Could you guide me how to fix it? Thanks
回答1:
System.DllNotFoundException: fusion.dll
AFAIK, Fusion.dll
is a type of DLL file associated with Microsoft .NET Framework for the Windows Operating System. VS 2017 for Mac could build apps for mobile, web, and Xamarin and .NET Core,etc. I assumed that this issue caused by using the package Microsoft.WindowsAzure.ConfigurationManager.
Please try to use the latest version of WindowsAzure.Storage and remove the Microsoft.WindowsAzure.ConfigurationManager package, then construct your CloudStorageAccount
instance as follows to narrow this issue.
CloudStorageAccount storageAccount = CloudStorageAccount.Parse("the-value-of-your-storage-connectionstring");
回答2:
So far, I found another solution to get key "StorageConnectionString" from App.config file for Xamarin PCL project.
You need to install this package which support to get the value of key in App.config file: PCLAppConfig
Then you can get the value by line code:
string storageConnectionString = PCLAppConfig.ConfigurationManager.AppSettings["StorageConnectionString"];
来源:https://stackoverflow.com/questions/48057194/error-system-dllnotfoundexception-fusion-dll-on-azure-storage-using-visual-stud