Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load DLL 'fusion.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E) #4010

Closed
JoyceLiang opened this issue Jan 23, 2018 · 23 comments
Assignees
Milestone

Comments

@JoyceLiang
Copy link

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:

  1. Create a simple console application using default template
  2. Add these Nuget packages:
  <ItemGroup>
    <PackageReference Include="WindowsAzure.Storage" Version="8.7.0" />
    <PackageReference Include="Microsoft.WindowsAzure.ConfigurationManager" Version="3.2.3" />
  </ItemGroup>
  1. 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");
  1. Run the application

Copied from original issue: Azure/azure-storage-net#596

@JoyceLiang
Copy link
Author

From @sameedaris on January 3, 2018 18:45

I was facing same issue . CloudConfigurationManager.GetSetting(accessKey) method looks into configuration files and it takes AppSetting key name only as parameter. but ironically i was passing whole connection string in place of Key so it was giving error . i think they need to correct exception message

@JoyceLiang
Copy link
Author

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 in Parse(settings) method.

@JoyceLiang
Copy link
Author

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.

@JoyceLiang
Copy link
Author

From @erezvani1529 on January 23, 2018 1:20

Thanks for reporting this issue. However, this issue should be opened on Azure Sdk repo as it is related to Microsoft.WindowsAzure.ConfigurationManager package.

Thanks!

@SaadMarwan
Copy link

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

static void Main(string[] args)
{
	MainAsync(args)).GetAwaiter().GetResult();
}

static async void MainAsync(string[] args)
{
	var storageCredentials = new StorageCredentials("myAccountName", "myAccountKey");
	var cloudStorageAccount = new CloudStorageAccount(storageCredentials, true);
	var cloudBlobClient = cloudStorageAccount.CreateCloudBlobClient();

	var container = cloudBlobClient.GetContainerReference("mycontainer");
	await container.CreateIfNotExistsAsync();
}

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();

@shahabhijeet shahabhijeet added this to the March 2018 milestone Mar 27, 2018
@mchenx
Copy link

mchenx commented Mar 30, 2018

any updates on this issue? it seems Microsoft.WindowsAzure.ConfigurationManager v3.2.3 was released in Oct, 2016 and had not been updated since then

@dsgouda dsgouda assigned shahabhijeet and unassigned dsgouda Apr 2, 2018
@shahabhijeet
Copy link
Member

@JoyceLiang we will have a release out soon for VS 2017.
Stay tuned for specific dates.
Apologies for the delay in responding.

@shahabhijeet
Copy link
Member

New version of Configuration manager has been released. Note the change in the name to align with our naming standards
Microsoft.Azure.ConfigurationManager

Please open a new issue, if you have any issues with the newly release package.

@dmvtech
Copy link

dmvtech commented Dec 28, 2018

I am having this issue.

Target framework: Asp.Net Core 2.1

Nuget packages:
Configuration Manager 4.0.0
Microsoft.AspNetCore 2.1.6
Microsoft.AspNetCore.All 2.1.6

Nuget warning if it matters:
Package 'Microsoft.Azure.ConfigurationManager 4.0.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project.

@TomaszGlazer
Copy link

Same here, using Microsoft.Azure.ConfigurationManager, Version=4.0.0.0 and getting:
Message = "Unable to load DLL 'fusion.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)"

Also getting the warning:
Package 'Microsoft.SharePointOnline.CSOM 16.1.8412.1200' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project.

@sameedaris
Copy link

I was facing same issue . CloudConfigurationManager.GetSetting(accessKey) method looks into configuration files and it takes AppSetting key name only as parameter. but ironically i was passing whole connection string in place of Key so it was giving error .
Please Check if you are passing Key name or whole String?

@TomaszGlazer
Copy link

No joy @sameedaris, I'm passing hardcoded values but GetAppOnlyAuthenticatedContext(url, appid, secret) is going belly up with Method not found: 'System.Runtime.Remoting.ObjectHandle System.Activator.CreateInstance(System.String, System.String)'.

@sameedaris
Copy link

hmm strange ..

@goldnarms
Copy link

I am also facing this issue. Tried using ConfigurationManager.GetSettings for a WebJob running in Azure to get values from AppSettings under the AppService, but "Unable to load DLL fusion.dll" pops up.

@Jordan466
Copy link

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

@csharpfritz
Copy link
Member

csharpfritz commented Jun 22, 2019

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

@AlexGhiondea
Copy link
Contributor

@shahabhijeet can you take a look?

@nviospvkuadt
Copy link

nviospvkuadt commented Aug 21, 2019

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);

@pomtom
Copy link

pomtom commented Jan 10, 2020

You can use string storageConnectionString = Environment.GetEnvironmentVariable("AzureWebJobsStorage");

@ScottyMac52
Copy link

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!

@Puiu
Copy link

Puiu commented Apr 15, 2020

I managed to get the settings using another approach:

`public Settings GetConfigurationSettings()
{
var config = new ConfigurationBuilder()
.AddJsonFile("local.settings.json", optional: true, reloadOnChange: true)
.AddEnvironmentVariables()
.Build();

        var settings = new Settings();
        config.Bind(settings);

        return settings;
    }`

My local.settings.json looks like this:
{ "IsEncrypted": false, "Values": { "AzureWebJobsStorage": "UseDevelopmentStorage=true", "MyStorageConnection": "UseDevelopmentStorage=true", "FUNCTIONS_WORKER_RUNTIME": "dotnet" } }

And the Settings class like this
public class Settings { public string MyStorageConnection{ get; set; }

@csharpfritz
Copy link
Member

Friends, this is broken... and we should move on with a work-around.

The documentation now recommends that you fetch configuration settings as EnvironmentVariables:

 System.Environment.GetEnvironmentVariable("AzureWebJobsStorage", EnvironmentVariableTarget.Process);

Let's close this issue and mark it as abandoned with this as the recommended work-around.

@jimboyuk
Copy link

jimboyuk commented May 4, 2020

This is shockingly bad. So I have an azure function that needs to call into some of my repository layer azure storage code to access a connection string. That layers uses the recommended library for acessing connection strings Microsoft.Azure.ConfigurationManager. And yet, from what I can see here, that is not supported so I have to rewrite my data layer just so that it can be called from an azure function???? I tell you, working with .net has become painful.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests