Failed to load file or assembly "CrystalDecisions.CrystalReports.Engine" / Windows 2012 server

we have an application written in .NET 4.0 that uses this SAP Crystal Reports. Although the same build (x86) works fine on Windows 2003/2008 (both x86 / x64) with .NET 4.0 (x86) installed and CrystalReports runtime (built from the SAP pages http://scn.sap.com / docs / DOC-7824 ) using 13.0.1.x (32bit_13_0_1.msi).

When the same material was installed on the MS 2012 (x64) server, the .NET Framework 4.5 was already installed, so I was unable to install .NET 4.0, but it looks like backward compatibility, because the application works correctly, except for the Crystal Reports part, where the application throws an exception.

Could not load file or assembly "CrystalDecisions.CrystalReports.Engine, version 10.5.3700.0, culture = neutral, PublicKeyToken = blahblah" or one of its dependencies. The system cannot find the specified file.

Of course, the runtime is set, but for some reason, our application cannot recognize these DLLs. Personally, I do not think this is a build problem, since it works correctly with the same configuration on the 2003/2008 server.

We have only the release version installed there, so there are no debugging options available, as well as VS.

Basically, we just perform some tests if the application runs correctly in 2012, but this problem seems impossible. I spent hours on Google to no avail. Therefore, any idea of ​​what to check is greatly appreciated :)

Thank you Thomas


Edit


Solution : Install earlier versions for 2008.
The root cause . On our build machine, we installed both operating modes (we also need to support older versions). In proj files, CR assemblies do not reference a specific version, simply by name. Thus, during the assembly process, the first lowest appropriate assembly from the GAC was used, and therefore CR 2008 must also be installed. The solution is to refer to third-party assemblies in the project files also by version, to force the use of newer ones.

+6
source share
3 answers

We encountered the same problem, however, a version was specified in our project. Also, our project was not called strong. Strongly naming assemblies would make this a problem.

.csproj to

<Reference Include="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\..\..\..\Workspace\SharedLibraries\trunk\Lib\CrystalDecisions.ReportSource.dll</HintPath> </Reference> 

Note that SpecificVersion is set to false. Switching this to a true ability to solve a problem, we have not tried this.

The hint path was either not found or was an older version. If he was not found, he would grab the first Crystal dll found in the GAC, which is version 10.5.

.csproj after

 <Reference Include="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=MSIL" /> 

This forces the assembly against the correct version.

+5
source

Another solution would be to upgrade to Crystal Reports for Visual Studio, compatible with VS2010 +. If you want to edit reports in recent Visual Studios, this is the way to go. Your decision to install the old runtime solves the problem without changing the solution, while the new version of the chip requires updating all reports in the solution.

+1
source

I solved this build error:

  • First only unistall package with NuGet package
  • The second is to install again using the NuGet package.
  • Lastly, publish and upload to VPS, and it will work.
+1
source

Source: https://habr.com/ru/post/945070/


All Articles