Could not load file or assembly CrystalDecisions.C

2020-03-02 04:13发布

My user's Terminal Runs 2 application. One of which I built an application using VS 2005 with Crystal Reports bundled version and another outside product which uses a different Crystal Report version. There were about 25 users who use the same combination but only one gives the the following error:

Could not load file or assembly 'CrystalDecisions.CrystalReports.Engine, Version = 12.0.2000.0, Culture=neutral, PublicKeyToken = 692fbea5521e1304' or one of its dependencies. The System cannot find the file specified.

See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.

********** Exception Text ********** System.IO.FileNotFoundException: Could not load file or assembly 'CrystalDecisions.CrystalReports.Engine, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified. File name: 'CrystalDecisions.CrystalReports.Engine, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' at Com.Isi.Client.OMSClient.CrystalReportViewer.LoadRuntime() at Com.Isi.Client.OMSClient.Program.LoadCrystalReportRuntime() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()

WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

********** Loaded Assemblies ********** mscorlib Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.17929 built by: FX45RTMREL CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll ---------------------------------------- AT Assembly Version: 4.30.29.0 Win32 Version: 4.30.29.0 CodeBase: file:///C:/Program%20Files/DirectFN/DirectFN%20Admin%20Terminal/AT.exe ---------------------------------------- System.Windows.Forms Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.17929 built by: FX45RTMREL CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System.Drawing Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.17929 built by: FX45RTMREL CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- System Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.17929 built by: FX45RTMREL CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- System.Configuration Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.17929 built by: FX45RTMREL CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll ---------------------------------------- Com.Isi.Client.OMSClient.Core Assembly Version: 4.30.29.1 Win32 Version: 4.30.29.1 CodeBase: file:///C:/Program%20Files/DirectFN/DirectFN%20Admin%20Terminal/Com.Isi.Client.OMSClient.Core.DLL ---------------------------------------- Com.Isi.Common.Shared Assembly Version: 4.30.24.0 Win32 Version: 4.30.24.0 CodeBase: file:///C:/Program%20Files/DirectFN/DirectFN%20Admin%20Terminal/Com.Isi.Common.Shared.DLL ---------------------------------------- System.Xml Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.17929 built by: FX45RTMREL CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- Microsoft.GeneratedCode Assembly Version: 1.0.0.0 Win32 Version: 4.0.30319.17929 built by: FX45RTMREL CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- Syncfusion.Shared.Base Assembly Version: 6.403.0.15 Win32 Version: 6.403.0.15 CodeBase: file:///C:/Program%20Files/DirectFN/DirectFN%20Admin%20Terminal/Syncfusion.Shared.Base.DLL ---------------------------------------- Microsoft.GeneratedCode Assembly Version: 1.0.0.0 Win32 Version: 4.0.30319.17929 built by: FX45RTMREL CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- Com.Isi.Client.ClientUtils Assembly Version: 4.30.24.0 Win32 Version: 4.30.24.0 CodeBase: file:///C:/Program%20Files/DirectFN/DirectFN%20Admin%20Terminal/Com.Isi.Client.ClientUtils.DLL ---------------------------------------- Com.Isi.Common.Tools Assembly Version: 4.30.24.0 Win32 Version: 4.30.24.0 CodeBase: file:///C:/Program%20Files/DirectFN/DirectFN%20Admin%20Terminal/Com.Isi.Common.Tools.DLL ---------------------------------------- Com.Isi.Client.ODCConnection Assembly Version: 4.30.24.0 Win32 Version: 4.30.24.0 CodeBase: file:///C:/Program%20Files/DirectFN/DirectFN%20Admin%20Terminal/Com.Isi.Client.ODCConnection.DLL ---------------------------------------- Com.Isi.Client.Trade.TradeService Assembly Version: 2.2.0.0 Win32 Version: 2.2.0.0 CodeBase: file:///C:/Program%20Files/DirectFN/DirectFN%20Admin%20Terminal/Com.Isi.Client.Trade.TradeService.DLL ---------------------------------------- Com.Isi.Client.Interfaces Assembly Version: 4.30.24.0 Win32 Version: 4.30.24.0 CodeBase: file:///C:/Program%20Files/DirectFN/DirectFN%20Admin%20Terminal/Com.Isi.Client.Interfaces.DLL ---------------------------------------- Microsoft.GeneratedCode Assembly Version: 1.0.0.0 Win32 Version: 4.0.30319.17929 built by: FX45RTMREL CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- System.Data Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.17929 built by: FX45RTMREL CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll ---------------------------------------- System.Core Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.17929 built by: FX45RTMREL CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll ---------------------------------------- Microsoft.GeneratedCode Assembly Version: 1.0.0.0 Win32 Version: 4.0.30319.17929 built by: FX45RTMREL CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- Com.Isi.Common.Controls Assembly Version: 4.30.24.0 Win32 Version: 4.30.24.0 CodeBase: file:///C:/Program%20Files/DirectFN/DirectFN%20Admin%20Terminal/Com.Isi.Common.Controls.DLL ---------------------------------------- Syncfusion.Tools.Windows Assembly Version: 6.403.0.15 Win32 Version: 6.403.0.15

CodeBase: file:///C:/Program%20Files/DirectFN/DirectFN%20Admin%20Terminal/Syncfusion.Tools.Windows.DLL

********** JIT Debugging ********** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled.

For example:

When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box.

Investigation reveals that in user's GAC, I found 2 versions of Crystal Report's CrystalDecisions.CrystalReports.Engine which are: 13.0.2000.0 10.2.3600.0

This is the same combination I found in other users' GAC. What triggers me the portion of the error which says "The System cannot find the file specified". Indeed there were no files specified under the version, but how come other users were using it. What is wrong?

6条回答
Deceive 欺骗
2楼-- · 2020-03-02 04:52

Try with installing SAP Crystal Reports runtime engine for .NET Framework. It works for me.

查看更多
Fickle 薄情
3楼-- · 2020-03-02 04:59

Hey I was also having this problem. In windows 7 vs2010 , But i installed this SAP Crystal Reports, developer version for Microsoft Visual Studio Updates & Runtime from this site now its working fine. Link is mentioned below

http://scn.sap.com/docs/DOC-7824

查看更多
闹够了就滚
4楼-- · 2020-03-02 05:00

I had the same problem. The first line of the exception message is indicating that your project is looking for Version = 12.0.2000.0.

Whenever I attempted to rebuild, messages in the Output window of Visual Studio (2015) indicated the same problem and prompted me to look at the preview.aspx file (C:\Windows\Microsoft.NET\Framework\v4.6.81\ASP.NETClientFiles\crystalreportviewers13\preview.aspx).

In my case, I simply changed the references from 12.0.2000.0 to 13.0.2000.0 (the version in the GAC).

Problem Solved.

Hope that helps!

查看更多
等我变得足够好
5楼-- · 2020-03-02 05:08

Here is one reason I got the error. I installed Crystal reports 11 version and the assembly in the GAC is 11.0.3300.0 (To check the version installed in your machine Windows+R => assembly). Screenshot/link below shows the version installed on my machine.

enter image description here

But in web.config of my code that I obviously checked out from my server is looking for crystal reports version 13.0.2000.0.

Solution: Renamed the version, PublickeyToken as per the installed crystal Reports version in my web.config. and this made my code running.

查看更多
淡お忘
6楼-- · 2020-03-02 05:10

I know this is an old question, but it was never answered, and I think this might help. I have seen this issue with using crystal reports while compiling in .NET Framework 4.0 or later. To fix it you have to add an app.config file to your project and put in an entry that tells the framework to use the legacy loader. See Crystal Reports are not working in Visual Studio 2010

<startup useLegacyV2RuntimeActivationPolicy="true">
  <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
查看更多
你好瞎i
7楼-- · 2020-03-02 05:15

Check out this post on when the GAC vs BIN folder gets used. It sounds possible that the other users have it in their bin folder. I'd start by checking there. Or in this case, I might start by putting it there and see if the problem is resolved, since you have a user that cannot work right now.

查看更多
登录 后发表回答