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

网站突发无法加载,报Cannot load a reference assembly for execution错误求助

Hey there, let’s work through this "Cannot load a reference assembly for execution" error you’re facing with your site on VS2017 and .NET Framework 4.7.1. Here are practical, tested fixes to resolve this issue:

Troubleshooting Steps
  • Fix misconfigured assembly references
    Sometimes assemblies get marked as "reference-only," which prevents them from being copied to the output directory at runtime.
    Right-click your project → References → Find the problematic assembly → Right-click Properties → Make sure Copy Local is set to True, and uncheck Specific Version (unless you explicitly need a fixed version).

  • Clean and rebuild your solution
    Stale build cache often causes weird runtime issues:

    1. Go to VS top menu → Build → Clean Solution
    2. Manually delete the bin and obj folders from your project directory
    3. Restart VS, then click Rebuild Solution
  • Repair .NET Framework 4.7.1 installation
    A corrupted .NET installation might be the root cause:

    • Open Control Panel → Programs and Features → Find ".NET Framework 4.7.1" → Right-click Change → Select Repair
    • If repair doesn’t work, uninstall it and download a fresh copy of .NET Framework 4.7.1 compatible with Windows 10 Home.
  • Verify project target framework
    Double-check your project is actually targeting .NET 4.7.1:
    Right-click your project → Properties → Application tab → Under Target framework, select .NET Framework 4.7.1, save changes, and rebuild.

  • Check web.config assembly binding redirects (for web projects)
    Incorrect binding redirects in web.config can block assembly loading. Open your web.config, locate the <runtime> → <assemblyBinding> section. Ensure the version redirects for your assemblies are correct, like this example:

    <dependentAssembly>
      <assemblyIdentity name="YourAssemblyName" publicKeyToken="your-token-here" culture="neutral" />
      <bindingRedirect oldVersion="0.0.0.0-1.0.0.0" newVersion="1.0.0.0" />
    </dependentAssembly>
    

    If you’re unsure, try commenting out suspicious redirects temporarily to test if the site loads.

  • Dig into detailed error logs
    Open VS’s Output Window (View → Output), switch to the Build or Debug output stream. Look for specific assembly names that failed to load—this will help you target the exact issue faster.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.19 07:18:37