Could not load file or assembly 'CrystalDecisions.Windows.Forms Error
I have created a Crystal Reports .Net Executable and it runs fine on the PC that it was built on. However, when I copy the exe application to another system and try to run it, I get the following error message:
System.InvalidOperationException was unhandled
Message="An error occurred creating the form. See Exception.InnerException for details. The error is: Could not load file or assembly 'CrystalDecisions.Windows.Forms, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified."
at Sample_Report.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
at Sample_Report.My.MyApplication.OnCreateMainForm() in C:\Users\saikaleya\AppData\Local\Temporary Projects\Sample Report\My Project\Application.Designer.vb:line 35
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String commandLine)
at Sample_Report.My.MyApplication.Main(String Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 78
Message="Could not load file or assembly 'CrystalDecisions.Windows.Forms, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified."
FileName="CrystalDecisions.Windows.Forms, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
FusionLog="WRN: Assembly binding logging is turned OFF.\r\nTo enable assembly bind failure logging, set the registry value [HKLM
Fusion!EnableLog] (DWORD) to 1.\r\nNote: There is some performance penalty associated with assembly bind failure logging.\r\nTo turn this feature off, remove the registry value [HKLM
Any tips/suggestions would be greatly appreciated.
P.S. I am using Crystal Reports 2008 and Visual Studio 2008.
Thank you in advance.
Jason Everly replied
A couple things here:
Your application is referencing the Windows form dll for the bundled version of Cr that comes with VS.NET 2008 and NOT the Crystal Reports 2008 runtime. You need to change the references in the project to 12.xxx assuming you have Crystal Reports 2008 SP0 installed (this is needed for it to work with .NET 2008)
You need to make sure you deploy the runtimes for the appropriate version. If you get your application upgraded to use all of the CR 2008 runtimes you will then need to deploy the runtimes to the machine you are deploying to. You can do this by using the merge modules or the server install msi to get them on the machine.