azure-sdk-for-net: Unable to load DLL 'fusion.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
From @nefcanto on December 23, 2017 15:1
Environment: VS 2017 Community edition 15.5.2 dotnet --version => 2.1.2 Windows 10 Enterprise
Steps to reproduce this bug:
- Create a simple console application using default template
- Add these Nuget packages:
<ItemGroup>
<PackageReference Include="WindowsAzure.Storage" Version="8.7.0" />
<PackageReference Include="Microsoft.WindowsAzure.ConfigurationManager" Version="3.2.3" />
</ItemGroup>
- Write these lines of codes to get a container:
var accessKey = "your access key";
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting(accessKey));
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference("images");
- Run the application
Copied from original issue: Azure/azure-storage-net#596
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 23 (5 by maintainers)
I had the same issue with .net core console app. I couldn’t make CloudConfigurationManager work so I used this approach instead
var storageCredentials = new StorageCredentials("myAccountName", "myAccountKey"); var cloudStorageAccount = new CloudStorageAccount(storageCredentials, true); var cloudBlobClient = cloudStorageAccount.CreateCloudBlobClient();
Once you have your cloud storage account reference you can do whatever you want. For example, creating a new container
var container = cloudBlobClient.GetContainerReference("mycontainer"); await container.CreateIfNotExistsAsync();
But remember that every remote action in the storage library is async so you have to do something like this
Reference: https://dotnetcoretutorials.com/2017/06/17/using-azure-blob-storage-net-core/
I only changed the Mainasync method call from
Task.Run(() => MainAsync(args)).GetAwaiter().GetResult();
to
MainAsync(args)).GetAwaiter().GetResult();
Friends, this is broken… and we should move on with a work-around.
The documentation now recommends that you fetch configuration settings as EnvironmentVariables:
Let’s close this issue and mark it as abandoned with this as the recommended work-around.
Why is this not fixed yet? I am using VS 2019 latest update and dot net core 3.1. This issue was moved from another area to here and it still isn’t fixed!!! This is inexcusable and extremely UNPROFESSIONAL!
I see the same issue when I try to use Microsoft.WindowsAzure.ConfigurationManager in ASP.NET Core Web Application. ASP.NET Web Application(.NET Framework) do not have this problem.
This is still a problem with Microsoft.Azure.ConfigurationManager 4.0.0 for .NET Core.
This version of the NuGet package (4.0.0) is built against NetFx 4.5.2 and is not compatible with .NET Core
Sample code demonstrating this issue can be found at: https://github.com/csharpfritz/BrokenAzureFunctions
Assuming you’ve hacked appsettings.json into your .NET Core console application (not included in the project template) then we’re just talking about getting a connection string - not sure why they want you to use an Azure library just to get an application setting…
var connectionString = configuration.GetConnectionString("AzureStorage"); CloudStorageAccount storageAccount = CloudStorageAccount.Parse(connectionString);
@shahabhijeet can you take a look?
Just an FYI, I was having this issue on an project using .net core 2.2 Switch the project over to .net framework 4.6.1 resolved the issue
From @user3301 on January 5, 2018 3:16
I had this issue before, when I try to load the configuration information using
CloudConfigurationManager.GetSettings(key)
this exception showed up, one workaround is put your exact value of you settings inParse(settings)
method.