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

DotNetNuke项目调用遇System.IO.FileNotFoundException问题求助

Troubleshooting 'System.IO.FileNotFoundException' in DotNetNuke Assembly Loading

Project Setup Recap

Let’s start by confirming your setup to align on the problem context:
You’ve built two DotNetNuke projects:

  • FormAndList: Contains the UpdateRow method that attempts to invoke logic from the second project
  • FormAndList_Ext: Hosts the UserDefinedController class that FormAndList depends on

Relevant Code Snippets

FormAndList - UpdateRow Method

public void UpdateRow(DataSet ds, int ModuleId, int TabId) 
{ 
    UserDefinedController udtc = new UserDefinedController(); 
    errMessage = udtc.userDefinedLogic(ds); 
}

FormAndList_Ext - UserDefinedController Class

public class UserDefinedController 
{ 
    #region Constructors 
    public UserDefinedController()
    {
        // Truncated constructor implementation from your snippet
    }
    
    // Assumed implementation of the called method
    public string userDefinedLogic(DataSet ds)
    {
        // Your custom logic here
    }
}

Common Causes & Fixes for the FileNotFoundException

This error occurs because DotNetNuke can’t locate the FormAndList_Ext assembly at runtime. Let’s work through the most likely fixes step by step:

1. Validate Project Reference Configuration

  • In your FormAndList project, confirm the reference to FormAndList_Ext is properly added:
    • Right-click FormAndList → Add → Reference → Ensure FormAndList_Ext is checked under the Projects tab.
  • Set the reference’s Copy Local property to True:
    • Right-click the FormAndList_Ext reference in FormAndList → Properties → Toggle Copy Local to True. This ensures the assembly is copied to FormAndList's bin folder during builds.

2. Check DotNetNuke’s Root Bin Directory

DotNetNuke loads assemblies from its site-wide bin folder by default. Verify:

  • FormAndList_Ext.dll (and .pdb for debugging) exists in your DNN site’s root bin directory.
  • For local development, add a post-build event to FormAndList_Ext to auto-copy the assembly to the DNN bin:
    • Go to FormAndList_Ext project properties → Build Events → Add this command (replace the path with your DNN site’s bin folder):
      copy "$(TargetDir)*.dll" "C:\YourDNNSitePath\bin" /Y
      copy "$(TargetDir)*.pdb" "C:\YourDNNSitePath\bin" /Y
      

3. Resolve Version or Strong Naming Conflicts

  • If FormAndList_Ext is strongly named, ensure the version referenced in FormAndList matches the version in the DNN bin folder. Version mismatches will block assembly loading.
  • Check your DNN site’s web.config for <assemblyBinding> redirects that might be overriding the expected assembly version.

4. Debug Assembly Loading with Fusion Logging

To get granular details about why the assembly isn’t loading:

  • Open the Developer Command Prompt for Visual Studio as an administrator.
  • Run fuslogvw.exe (Assembly Binding Log Viewer).
  • Click Settings → Select Log bind failures to disk → Choose a log directory.
  • Reproduce the error, then check the fusion log to see exactly where DNN is searching for FormAndList_Ext and what’s causing the failure.

5. Verify Module Packaging (If Deploying)

If you’re packaging these as DNN modules:

  • Ensure FormAndList_Ext.dll is included in the module package’s bin folder.
  • Confirm your module manifest (.dnn file) lists FormAndList_Ext as a required assembly resource.

内容的提问来源于stack exchange,提问作者Chan Yoong Hon

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.21 08:11:30