Could not load file or assembly or one of its dependencies DNN error

DNN > Troubleshooting
 
Could Not Load File or Assembly or One of its Dependencies Cause and ResolutionIssue
When you go to your website, you receive an error message similar to the following:
 
Server Error in '/' Application.
Could not load file or assembly 'SomeFile' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Cause
This issue occurs when one of two things occurs:
  • The file being referenced is not the correct version.
  • The file is referencing a component that does not exist or is the wrong version.
Resolution
In order to resolve this issue, you will need ensure that the component being referenced is the correct version and all of its dependencies are present.  A good starting point is to compare the file version of the erroring component to similar DotNetNuke websites and ensure that the file does exist and is the correct version.  If you are receiving this error after installing or upgrading a third party module, you may need to contact your vendor for additional assistance.

Removing the offending file from the /BIN/ folder and placing it in a new folder ( /BIN_BAD/ ) may provide a temporary workaround to this issue and help you diagnose the problem.

Shared Hosting Account
  1. Log into your DNN site via FTP
  2. Navigate to Httpdocs > bin
  3. Locate the *.dll file in question (I am using the Telerik.Web.UI.DLL in this example)
  4. Download a copy of the file to your local machine
  5. Right click on the file you just downloaded and click Properties > Details
  6. Write down the product version (2011.03.1115.35 in my example)
  7. Open your web.config file
  8. Look for this code block
  9. <dependentAssembly>
            <assemblyIdentity name="Telerik.Web.UI" publicKeyToken="121fae78165ba3d4" />
            <!--Upgraded by DotNetNuke.Telerik.Web version 6.1.3 - Date: 4/13/2012 11:14:06 AM-->
            <!--<bindingRedirect oldVersion="2008.0.0.0-2020.0.0.0" newVersion="2011.3.1115.35" xmlns="urn:schemas-microsoft-com:asm.v1" />-->
            <bindingRedirect oldVersion="2008.0.0.0-2020.0.0.0" newVersion="2011.3.1115.35" />
    </dependentAssembly>
  10. The number in [ newVersion="2011.03.1115.35" /> ] should be the same number as the DLL you downloaded. If not change the web.config to match what version you have in the /bin folder.

Dedicated Server Account
  1. Use Remote Desktop to log into your dedicated server.
  2. Navigate to Httpdocs > bin folder
  3. Locate the *.dll file in question. (I am using the Telerik.Web.UI.DLL in this example.)
  4. Right click on the file you just located and click Properties > Details
  5. Write down the product version (2011.03.1115.35 in my example)
  6. Open your web.config file.
  7. Look for this code block
    <dependentAssembly>
            <assemblyIdentity name="Telerik.Web.UI" publicKeyToken="121fae78165ba3d4" />
            <!--Upgraded by DotNetNuke.Telerik.Web version 6.1.3 - Date: 4/13/2012 11:14:06 AM-->
            <!--<bindingRedirect oldVersion="2008.0.0.0-2020.0.0.0" newVersion="2011.3.1115.35" xmlns="urn:schemas-microsoft-com:asm.v1" />-->
            <bindingRedirect oldVersion="2008.0.0.0-2020.0.0.0" newVersion="2011.3.1115.35" />
    </dependentAssembly>
  8. The number in [ newVersion="2011.03.1115.35" /> ] should be the same number as the DLL you downloaded. If not change the web.config to match what version you have in the /bin folder.








 

Add Feedback