cancel
Showing results for 
Search instead for 
Did you mean: 

Unhandled exception... Could not load file or assembly...

Former Member
0 Kudos

I hope this question will be easier to resolve than my most recent one as this is a message that occurs after I deploy my application to another workstation when I bring up a form which contains the Crystal Report preview frame on it:

*Unhandled exception has occurred in your application. If you click

Continue, the application will ignore this error and attempt to continue. If

you click Quit, the application will close immediately.

Could not load file or assembly 'CrystalDecisions.Windows.Forms,

Version=12.0.2000.0, Culture=neutral,

PublicKeyToken=692fbea5521e1304' or one of its dependencies. The

system cannot find the file specified.*

When I click on Details, this is what I see:

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.Windows.Forms, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.

File name: 'CrystalDecisions.Windows.Forms, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304'

at dmwill.frmReport.InitializeComponent()

at dmwill.frmReport..ctor()

at dmwill.frmMain.MnuPrint_Click(Object sender, EventArgs e)

at System.Windows.Forms.MenuItem.OnClick(EventArgs e)

at System.Windows.Forms.MenuItem.MenuItemData.Execute()

at System.Windows.Forms.Command.Invoke()

at System.Windows.Forms.Command.DispatchID(Int32 id)

at System.Windows.Forms.Control.WmCommand(Message& m)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

at System.Windows.Forms.ContainerControl.WndProc(Message& m)

at System.Windows.Forms.Form.WndProc(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

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: 2.0.0.0

Win32 Version: 2.0.50727.3082 (QFE.050727-3000)

CodeBase: file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll

-


dmwill

Assembly Version: 1.0.3582.26051

Win32 Version: 1.0.3582.26051

CodeBase: file:///C:/Program%20Files/Accucom%20Consulting/Will%20Program/dmwill.exe

-


Microsoft.VisualBasic

Assembly Version: 8.0.0.0

Win32 Version: 8.0.50727.3053 (netfxsp.050727-3000)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll

-


System

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

-


System.Windows.Forms

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

-


System.Drawing

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

-


System.Runtime.Remoting

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll

-


System.Data

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)

CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll

-


System.Xml

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3082 (QFE.050727-3000)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll

-


System.Transactions

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)

CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll

-


System.EnterpriseServices

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)

CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll

-


System.Configuration

Assembly Version: 2.0.0.0

Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)

CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.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:

<configuration>

<system.windows.forms jitDebugging="true" />

</configuration>

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.

Edited by: jfalberg on Oct 22, 2009 10:51 PM

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Is CrystalDecisions.Windows.Forms, Version=12.0.2000.0 installed? How did you deploy the CR runtime?

Ludek

Former Member
0 Kudos

I believe I'm using the following merge modules based on the ones originally used with Crystal Reports 9:

crnetruntime.msm (dated 12/19/2005)

license.msm

mapping.msm

reportengine.msm

I see there's a download for the new merge modules for CR 2008 along with service packs as well and was going to start with the original one which I believe is CRRuntime_12_0.msm and not sure if I should include all the other languaged ones and most likely the one with CRRuntime_12_0_maps.msm if that's for mapping unless I'm mistaken somehow.

My assumption is that I must have CrystalDecisions.Windows.Forms, Version=12.0.2000.0 installed on my workstation at least since it works there but is using the incorrect versions in my deployment setup.

former_member183750
Active Contributor
0 Kudos

Using the correct install files is critical. See [this|https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=56787567] wiki for locations of runtime file downloads and otehr how to information.

Ludek

Former Member
0 Kudos

I tried adding CRRuntime_12_2.msm as a merge module since I'm apparently using a crystal windows forms version 12 and intend to use a Windows 7 operating system, but when I went to rebuild the solution, I got 1 error and 38 warnings which included some the following:

Error 39 Unable to import merge module 'C:\devel\dmlawyers\dmwill\mm2\CRRuntime_12_2.msm' C:\devel\dmlawyers\dmWillSetup\dmWillSetup.vdproj dmWillSetup

Warning 1 Unable to find module dependency with signature 'CRT.98CB24AD_52FB_DB5F_FF1F_C8B3B9A1E18E' C:\devel\dmlawyers\dmWillSetup\dmWillSetup.vdproj dmWillSetup

Warning 12 Item 'Crystal Reports 2008' could not find dependent item 'Microsoft.Data.Access.Components.2.8'. C:\devel\dmlawyers\dmWillSetup\dmWillSetup.vdproj dmWillSetup

Warning 13 Two or more objects have the same target location ('[gac]\crystaldecisions.enterprise.pluginmanager.dll') C:\devel\dmlawyers\dmWillSetup\dmWillSetup.vdproj dmWillSetup

Warning 31 Error merging 'CRRuntime_12_2.msm': Unable to merge data from the merge module because it conflicts with existing data in the package.

MergeModule: table='Directory' row='DesktopFolder'

Database: table='Directory' row='DesktopFolder' C:\devel\dmlawyers\dmWillSetup\dmWillSetup.vdproj dmWillSetup

former_member183750
Active Contributor
0 Kudos

If you are using .NET 2005, see [this|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/13427] [original link is broken] [original link is broken] [original link is broken]; blog.

If you are using .NET 2008, see [this|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/14789] [original link is broken] [original link is broken] [original link is broken]; blog, post from July 17 and click on the links to the referenced notes.

Ludek

Former Member
0 Kudos

Since I had the following import statements in my dotnet form:

Imports CrystalDecisions.CrystalReports.Engine

Imports CrystalDecisions.ReportSource

Imports CrystalDecisions.Shared

Imports CrystalDecisions.Windows.Forms

Here is where I'm at now as I removed CRRuntime_12_2.msn and added the following items:

CrystalDecisions.CrystalREports.Engine.dll

CrystalDecisions.Data.AdoDotNetInterlop.dll

CrystalDecisions.ReportAppServer.CommLayer.dll

CrystalDecisions.ReportSource.dll

CrystalDecisions.Shared.dll

CrystalDecisions.Windows.Forms.dll

But after I deployed it onto another workstation, and while the form with the report frame now comes up without an error, the following message pops up when I attempt to run my report.

An error has occurred while attempting to load the Crystal Reports runtime. Either the Crystal Reports registry key permissions are insufficient, or the Crystal Reports runtime is not installed correctly. Please install the appropriate Crystal Reports redistributable (CRRedist*.msi) containing the correct version of the Crystal Reports runtime (x86, x64, or Itanium) required. Please go to http://www.businessobjects.com/support for more information.

I also tried installing from CRRedist2008_x86.msi and I still got the same message. I seem to be missing something still.

former_member183750
Active Contributor
0 Kudos

Let's look at the runtime first;

Do you see the directory c:\program files\business objects\businessobjects enterprise 12.0\win32_x86?

Do you see the CR assemblies in the GAC?

If these are there, then perhaps as the error says, there is some sort of a permission issue. using Process Monitor may tell us where that issue would be. ProcMon is here;

http://technet.microsoft.com/en-ca/sysinternals/bb896645.aspx

look for Access Denied messages.

Ludek

Former Member
0 Kudos

If I understand correctly, I am looking for c:\program files\business objects\businessobjects enterprise 12.0\win32_x86 on the client workstation? If so, then I don't see it there, just the "common" folder under "business objects"

former_member183750
Active Contributor
0 Kudos

Yes, that is correct. You should be able to see the folder structure on your dev computer and this same structure must be on the runtime box. If it is not there, something did not go correctly during the install.

Try to run the MSI (just double click on it) by it's self on that box - just as a test.

Ludek

Former Member
0 Kudos

The workstation I'm trying to install the CRRedist2008_x86.msi uses Windows XP as it says that it's gathering required information, then it seems to disappear. Perhaps I should try installing on a Windows Vista or Windows 7 workstation if it was not meant to work on an XP workstation?

former_member183750
Active Contributor
0 Kudos

It should work on XP. Double clicking on the msi does the same thing?

Try to install an eval of CR 2008 from [here|http://www.sap.com/solutions/sapbusinessobjects/sme/freetrials/index.epx]

on that box, see if it produces any warning / errors.

Ludek

Former Member
0 Kudos

After I installed the evaluation version of CR 2008 my program on XP workstation seemed to work. I wonder if there's a way in my deployment method that I should be able to make CR 2008 automatically work for the report portion rather than making a separate MSI installation. Here are the files I now see in my deployment folder after I install from my project:

BusinessObjects.Licensing.KeycodeDecoder.dll

CEReportSource.dll

CrystalDecisions.CrystalReports.Engine.dll

CrystalDecisions.Data.AdoDotNetInterop.dll

CrystalDecisions.Enterprise.Viewing.ReportSource.dll

CrystalDecisions.ReportAppServer.CommLayer.dll

CrystalDecisions.ReportAppServer.Prompting.dll

CrystalDecisions.ReportSource.dll

CrystalDecisions.Shared.dll

CrystalDecisions.Windows.Forms.dll

dmwill.exe

Wills.mdb

The last 2 are my executable and an access database.

former_member183750
Active Contributor
0 Kudos

The only way to deploy CR 12.x runtime, is documented in the link I provided in the post from Oct 23, 2009.

Ludek

Former Member
0 Kudos

I noticed my program worked when I installed with CRRuntime_12_0_mlb.msi although it did ask me for a product ID as I used the one for my Evaluation product and then it continued to install. Even though the product ID was from an evaluation version, will my program's crystal report viewing cease to work after 30 days if I continue with the evaluation code? Otherwise, I'd assume that each time I deploy my program that I would only need to install the CR Runtime once at least.

former_member183750
Active Contributor
0 Kudos

The eval keycode code will expire no matter what. You will have to obtain a permanent keycode.

Ludek

Former Member
0 Kudos

Given that when I do have a permanent keycode, is it possible that when I build my deployment from visual studio 2008 to also automatically deploy the CR Runtime along with embedding the product keycode without having to keep doing it separately when setting up on different workstations which all reference the same network drive?

former_member183750
Active Contributor
0 Kudos

Yes. The MSM is configurable, so all you have to do is inter the keycode into the keycode property.

The SP 0 MSI does require a keycode, SP 1 and SP 2 do not.

Ludek

Former Member
0 Kudos

I tried adding CRRuntime_12_0_mlb.msi as part of my deployment project but did not see a keycode property. Is there a merge module that I specifically need that will accomplish the same thing that the msi file would do so I don't have to run separate installs?

former_member183750
Active Contributor
0 Kudos

The MSM is configurable, the MSI is not.

Ludek

Former Member
0 Kudos

I believe I finally got this to work as I used the CRRuntime_12_0.msn merge module and added the keycode there. I had it before but did not realize it conflicted with another merge module I needed to remove since it had redundancy for an older version.

It appears that all I have left is non-CR related stuff as I can finally see the light at the end of this tunnel. Thanks again for your patience in helping me get through this Ludek.

former_member183750
Active Contributor
0 Kudos

Happy to have been able to at least point this in the right direction. Just wish I could have done it a bit faster, so thank you for hanging in there :).

Ludek

Answers (0)