cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports for Visual Studio - Deployment Issue

0 Kudos

This is the third Crystal reports app I have created. I am seeing this error when trying to run the app on the client machines. I have run the msi setup file for both my app and the CR runtime SP 29. The error I am seeing is below. I have verified that CrystalDecisions.Shared.dll has been added to the dependencies for my setup file and as a reference within the app. Does anyone know what could possibly be causing this?

Application: M-Files - Planned Material Report.exe

Framework Version: v4.0.30319

Description: The process was terminated due to an unhandled exception.

Exception Info: System.IO.FileNotFoundException

at CrystalDecisions.Shared.SharedUtils..cctor()

Exception Info: System.TypeInitializationException

at CrystalDecisions.Shared.SharedUtils.get_CurrentControl()

at CrystalDecisions.Shared.SharedUtils.GetEffectiveCulture()

at CrystalDecisions.Shared.LocaleManager..ctor()

at CrystalDecisions.Windows.Forms.CrystalReportViewer.InitReportViewer()

at CrystalDecisions.Windows.Forms.CrystalReportViewer..ctor()

at M_Files___Planned_Material_Report.Form1.InitializeComponent()

at M_Files___Planned_Material_Report.Form1..ctor()

Exception Info: System.InvalidOperationException

at M_Files___Planned_Material_Report.My.MyProject+MyForms.Create__Instance__[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.__Canon)

at M_Files___Planned_Material_Report.My.MyProject+MyForms.get_Form1()

at M_Files___Planned_Material_Report.My.MyApplication.OnCreateMainForm()

at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()

at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()

at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(System.String[])

at M_Files___Planned_Material_Report.My.MyApplication.Main(System.String[])

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Ah, ttx is legacy, I don't believe we have a 64 bit version so convert to a Dataset() or using ADO.NET (XML), SetLocation() should update the report. If lots of data use XML files.

In VS show all the references, change all CR References Copy Local to false.

That way once the MSI package is installed it'll load them from the GAC, preferred way.

Don

0 Kudos

Hi,

One question on using a dataset or XML. Currently the only data structure in the report is from the ttx file. In order to remove the ttx file, would I use the xml schema file to create the columns instead of the ttx file? I am assuming the report should no longer reference the ttx file, but there are formulas built on the fields that the ttx schema created. See below for my current schema based on the ttx file.

0 Kudos

I was able to get this working by replacing the ttx file as a datasource with the xml schema i exported out of my ADO.net dataset. I also tested the report on a client PC and it is now working. Thank you so much Don. You have helped me with a few projects now. I also made it so the references are not copied locaclly!

Answers (5)

Answers (5)

0 Kudos

Hi Chris,

CR runtime is based on your app platform, x86 or x64, and not the OS.

So in 64 bit mode CR requires all 64 bit dependencies, including the database driver the report uses, if it doesn't exist in 64 bits then your app is not going to work.

Another thing you must not do is for all CR assemblies DO NOT set the Copy Local option, your app can be confused if your \bin folder has CR assemblies and they are in the GAC as well. You should not see any CR dll's in your \bin folder.

Open your report, click on Database and expand the properties, you'll see the name of the Dll CR is using to connect, something like crdb_ODBC.dll or crdb_ado.dll etc.

Which one is your report using?

Another test if your DB is supported in 64 bit is on a different PC download CR 2020, it's 64 bit only designer:

https://www.sap.com/products/crystal-reports.html?btp=0a62d81d-9ae0-475e-8079-8c4bd1dbc0ee

You can't have more than one version installed locally.

Open your report and try to preview it, if it works then you have all the piece, if you get a database error you don't.

Don

0 Kudos

This report was originally created with a ttx file so that is what I am using to populate the database fields in the report. I then fill the ttx structure with a dataset in vb.net. I looked at the properties of the ttx in crystal reports and I don't see anything indicating what dll it is using. Is the ttx what is causing the problem? Should i be creating a datatable from my dataset instead of using a ttx file to fill the report data structure? I do have the CR assemblies in the bin folder. What is the best way to remove these and only use the GAC assemblies? When I add a reference to the project for CR assemblies doesn't this add it to the bin folder?

0 Kudos

Since your app is now running in 64 bit mode it needs a 64 bit version of ADO.NET.

https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/dataset-datatable-dataview/security-gu...

Be sure to remove the legacyMode for CR to work also in the app.config file.

0 Kudos

I went through this guide and I don't really understand what I am supposed to do. There are a lot of topics I have never seen before. That being said, is it best to target 32 bit apps for Crystal report apps? I could convert it back to 32 bit where it works properly and then deploy the 32 bit runtime. The reason I was targeting 64 bit is because we are using 64 bit windows, but from what I read it should be able to support both 64 and 32 bit apps. Is there a merge module for the 32 bit runtime?

0 Kudos

I deployed the 32 bit version that is working properly on my machine, but when deployed the app doesn't open and I see the below error in the event viewer. The path that it is looking for this dll is incorrect. It should be looking in C:\Windows\SysWOW64, why is the app looking in the wrong folder for the file? Any thoughts?

Log Name: Application

Source: Application Error

Date: 1/13/2021 11:06:10 AM

Event ID: 1000

Task Category: (100)

Level: Error

Keywords: Classic

User: N/A

Description:

Faulting application name: M-Files - Planned Materials Report.exe, version: 1.0.0.0, time stamp: 0x5fff259e

Faulting module name: WRDll.x86.dll, version: 1.1.0.227, time stamp: 0x5f45cd02

Exception code: 0xc0000005

Fault offset: 0x00007ebf

Faulting process id: 0x2524

Faulting application start time: 0x01d6e9ce63cda2d1

Faulting application path: C:\Program Files (x86)\Kage Innovation\M-Files - Planned Materials Report Setup\M-Files - Planned Materials Report.exe

Faulting module path: C:\WINDOWS\System32\WRDll.x86.dll

Report Id: 61486196-e4bf-430e-b0a0-4085b3ce424e

Faulting package full name:

Faulting package-relative application ID:

Event Xml:

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">

<System>

<Provider Name="Application Error" />

<EventID Qualifiers="0">1000</EventID>

<Level>2</Level>

<Task>100</Task>

<Keywords>0x80000000000000</Keywords>

<TimeCreated SystemTime="2021-01-13T17:06:10.328488500Z" />

<EventRecordID>460725</EventRecordID>

<Channel>Application</Channel>

<Computer>WS-10-CAD.ad.kage.com</Computer>

<Security />

</System>

<EventData>

<Data>M-Files - Planned Materials Report.exe</Data>

<Data>1.0.0.0</Data>

<Data>5fff259e</Data>

<Data>WRDll.x86.dll</Data>

<Data>1.1.0.227</Data>

<Data>5f45cd02</Data>

<Data>c0000005</Data>

<Data>00007ebf</Data>

<Data>2524</Data>

<Data>01d6e9ce63cda2d1</Data>

<Data>C:\Program Files (x86)\Kage Innovation\M-Files - Planned Materials Report Setup\M-Files - Planned Materials Report.exe</Data>

<Data>C:\WINDOWS\System32\WRDll.x86.dll</Data>

<Data>61486196-e4bf-430e-b0a0-4085b3ce424e</Data>

<Data>

</Data>

<Data>

</Data>

</EventData>

</Event>

0 Kudos

I figured this out. For some reason my setup file was targeting x86 (I don't remember changing this). The form now load. The only issue I have now is that it says the database failed to load on the client PC. I'll start debugging this more on Monday.

0 Kudos

I can't figure out why this says db failed to load. It happened when i switch from any cpu to targetting x64. It's like my dataset is no longer valid for the report when I do that. Any ideas what would cause this?

0 Kudos

I am using SP29 when developing the app in visual studio. The initial form of the app never loads, so I would assume that it is erroring out on form load. This app works as expected on my development PC. I also have a try catch block surrounding all of the code in my app, when there is an exception it is supposed to email me what is contained in the ex of the exception. This email never kicks off, so the code never makes it to Form1, otherwise it would activate the try catch block I created.

DellSC
Active Contributor
0 Kudos

Was SP 29 used when developing your app? If not, that could cause this issue - the SP used in Visual Studio and the SP of the runtime should match.

If that's not the issue, what is happening in the application when this error occurs? Based on the call stack, CrystalDecisions.SharedUtils is loaded, so that's not the file that's missing.

-Dell