Bug in Access Database Compare Tool

StewartBW 1,905 Reputation points
2024-06-17T15:11:21.3+00:00

Hello

As seen in the screenshot:

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.ReportViewer.WinForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

File name: 'Microsoft.ReportViewer.WinForms, Version=9.0.0.0

DB

Microsoft 365 and Office | Access | For business | Windows
{count} votes

1 answer

Sort by: Most helpful
  1. peiye zhu 320 Reputation points
    2025-10-14T04:05:46.8266667+00:00

    The error message you're encountering typically happens when the application is unable to locate the specified version of the Microsoft.ReportViewer.WinForms assembly. This could be due to a missing or incorrectly configured reference to the assembly. Here are a few steps you can follow to resolve it:

    1. Install the Required Version of ReportViewer

    Make sure you have the correct version of the ReportViewer installed on your system. For version 9.0.0.0, you will need to install the Microsoft Report Viewer 2010 Redistributable or a compatible version. You can download it from the official Microsoft website:

    If you need the latest version, you may need to install Microsoft.ReportViewer.2015 or 2017 from NuGet (depending on your project requirements).

    2. Check Project References

    Ensure that your project has a proper reference to the Microsoft.ReportViewer.WinForms assembly. To verify or add the reference:

    • In Visual Studio, right-click on your project in the Solution Explorer and select Add Reference.
    • Go to the Assemblies tab or Browse if it’s not listed.
    • Search for Microsoft.ReportViewer.WinForms or browse to where it's installed on your system (typically in C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\ReportViewer or a similar folder).

    3. Ensure Correct Version in App.config (or Web.config)

    Check your App.config (or Web.config if it's a web project) for assembly binding redirects. If you have a binding redirect for Microsoft.ReportViewer.WinForms, make sure it's pointing to the correct version. It should look something like this:

    
    <runtime>
    
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    
        <dependentAssembly>
    
          <assemblyIdentity name="Microsoft.ReportViewer.WinForms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
    
          <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
    
        </dependentAssembly>
    
      </assemblyBinding>
    
    </runtime>
    
    

    If you are using a different version, adjust the newVersion attribute to match it.

    4. Rebuild the Project

    After ensuring that the correct version of the assembly is referenced, rebuild your project to make sure the references are correctly resolved.

    5. Check for Missing Dependencies

    If the issue persists, check if there are any other dependencies that are missing. You can use tools like ILSpy or dotPeek to inspect the assembly references and ensure all required libraries are included.

    6. Consider NuGet Packages

    For convenience, you can also try adding the Microsoft.ReportViewer.WinForms via NuGet. In Visual Studio:

    • Right-click on your project in the Solution Explorer.
    • Choose Manage NuGet Packages.
    • Search for Microsoft.ReportViewer.WinForms and install the appropriate version.

    This will automatically add the necessary references and manage the versioning for you.

    7. Check Platform Compatibility

    Ensure that your project is targeting the correct platform (x86, x64, or Any CPU). If you're working with a 32-bit version of Microsoft.ReportViewer.WinForms, make sure your application is built for the correct architecture.

    Let me know how it goes, or if the issue persists, we can try troubleshooting further.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.