You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Visual Studio for Mac操作Azure Storage遇fusion.dll缺失异常求修复指引

Fixing System.DllNotFoundException: fusion.dll in Visual Studio for Mac

Hey there, let's get this fusion.dll error sorted out for you. The root cause here is that fusion.dll is a Windows-only system assembly used by .NET Framework, and your current code relies on older Azure Storage libraries tightly coupled to Windows-specific components. Since Visual Studio for Mac focuses on cross-platform .NET (Core/.NET 5+), this mismatch is triggering the error. Here are actionable fixes to resolve it:

The old WindowsAzure.Storage package (which includes CloudStorageAccount and CloudConfigurationManager) is legacy and not optimized for cross-platform use. Replace it with the official modern Azure.Storage.Blobs package built for cross-platform .NET:

  • Uninstall the WindowsAzure.Storage NuGet package from your project.
  • Install the Azure.Storage.Blobs package via NuGet.
  • Replace your connection string code with this cross-platform compatible version:
    using Azure.Storage.Blobs;
    using Microsoft.Extensions.Configuration;
    
    // Load configuration from appsettings.json (or your preferred config source)
    var configBuilder = new ConfigurationBuilder()
        .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);
    IConfiguration config = configBuilder.Build();
    
    // Retrieve the storage connection string
    string storageConnectionString = config["StorageConnectionString"];
    
    // Initialize the modern Blob service client (replaces CloudStorageAccount)
    BlobServiceClient blobServiceClient = new BlobServiceClient(storageConnectionString);
    
    This approach uses .NET's cross-platform IConfiguration system instead of Windows-only CloudConfigurationManager, eliminating the dependency on fusion.dll.

2. Verify Your Project Targets a Cross-Platform .NET Framework

Make sure your project isn't targeting .NET Framework (a Windows-only runtime):

  • Right-click your project in Visual Studio for Mac → Properties → Application tab.
  • Under Target framework, select a cross-platform version like .NET 6/7/8 or .NET Core 3.1.

3. Clean and Rebuild to Clear Cached Artifacts

Sometimes stale build files can cause unexpected dependency issues:

  • Go to Build → Clean Solution.
  • Manually delete the bin and obj folders from your project directory.
  • Go to Build → Rebuild Solution.
  • Restore NuGet packages by right-clicking the project → Restore NuGet Packages.

Why This Happens on Mac but Not Windows

CloudConfigurationManager from the old Azure SDK uses .NET Framework-specific APIs that depend on fusion.dll—a file that doesn't exist on macOS. Windows Visual Studio works because it runs on an OS where this DLL is natively present. The modern Azure Storage SDK removes these Windows-specific ties, making it fully compatible with macOS.

内容的提问来源于stack exchange,提问作者Tony Pham

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 06:54:54