Skip to Content
avatar image
Former Member

Assembly loading errors

Hello. I'm having a problem with SAP CrystalReports during runtime.

First, the assembly file isn't found, even though CrystalReports is installed and all assemblies are registered:

System.Configuration.ConfigurationErrorsException: Could not load file or assembly 'CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral' or one of its dependencies. The system cannot find the file specified. (C:\Program Files\FMS\GeoPortal2\reporting\web.config line 34) ---> System.IO.FileNotFoundException: Could not load file or assembly 'CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral' or one of its dependencies. The system cannot find the file specified.

I then tried to set the CrystalDecisions.Web assembly in the project to "Copy Local"=true, so that it would be included in the deployed project. That got me a different error:

System.Web.HttpCompileException (0x80004005): c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\geo2\e2a70b87\2b9be05\App_Web_reportviewer.aspx.733fdbe7.njrhyncf.0.cs(254): error CS0433: The type 'CrystalDecisions.Web.CrystalReportViewer' exists in both 'c:\Windows\assembly\GAC_MSIL\CrystalDecisions.Web\13.0.2000.0__692fbea5521e1304\CrystalDecisions.Web.dll' and 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\geo2\e2a70b87\2b9be05\assembly\dl3\4e808648\047538f8_8e06d101\CrystalDecisions.Web.DLL'

It looks like IIS can't find the CrystalDecisions.Web assembly in the GAC, but when the assembly is included in the project, it finds both and sees a conflict.

What could be the problem and how can I solve it?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Oct 30, 2015 at 02:56 PM

    Hi Martins

    You say; the assembly file isn't found, even though CrystalReports is installed and all assemblies are registered

    What version of CR did you install?

    What is the actual file you used for the install?

    - Ludek

    Senior Support Engineer AGS Product Support, Global Support Center Canada

      Follow me on Twitter

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Martins,

      What OS are you running this on?

      What version of VS are you using?

      If you own that viewer aspx file don't delete it. The actual file name I was asking about is preview.aspx.

      Does it work on your DEV PC?

      The default is IISExpress which uses the Viewer in this folder:

      C:\Windows\Microsoft.NET\Framework\v4.0.30319\ASP.NETClientFiles\crystalreportviewers13

      In IIS it uses the Viewer folder that is either included with the project or the default:

      C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319\crystalreportviewers13

      Look for multiple web.config files, it could be the app is loading the wrong one. Error indicates it's using this one located in that folder:

      The system cannot find the file specified. (C:\Program Files\FMS\GeoPortal2\reporting\web.config line 34)

      Is that the right one?

      Is the 2.0->3.5 Framework installed on your IIS PC? Cr requires it.

      Does a simple "Hello World" app work, not using CR runtime at all?

      What account is IIS running under? Have you tried others?

      On your DEV PC set the WEB Server to use your real IIS Server by changing the project properties to your startpage.aspx:

      What happens?

      Don

      pastedImage_0.png (47.5 kB)
  • avatar image
    Former Member
    Nov 06, 2015 at 07:13 PM

    After fiddling with Web.config references some more I did manage to get it working for about a day. I don't know exactly what helped, but I removed all references to CrystalReports and then slowly added the required ones back one by one until it worked.

    However, today, after making some changes elsewhere in the application (unrelated to CrystalReports), I am suddenly consistently getting the duplicate error again:

    c:\Windows\ Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\91510cab\118f7e61\App_Web_reportviewer.aspx.733fdbe7.suglc0g9.0.cs(323): error CS0433: The type 'CrystalDecisions.Web.CrystalReportViewer' exists in both 'c:\Windows\assembly\GAC_MSIL\CrystalDecisions.Web\13.0.2000.0__692fbea5521e1304\CrystalDecisions.Web.dll' and 'c:\Windows\ Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\91510cab\118f7e61\assembly\dl3\d5663533\80751e09_d9a1cf01\CrystalDecisions.Web.DLL'

    This is on a Windows 10 (64-bit) dev machine, with CrystalReports 13.0.15 installed (using .exe) file and "Copy Local" is set to "False" for all CrystalReports references in the Visual Studio project.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Don Williams

      I am using the .exe to install CR for Visual Studio on my development machine, and the .msi to install it on the deployment test server.