Last post Mar 18, 2019 09:11 PM by DoctorWho
Mar 14, 2019 09:50 PM|DoctorWho|LINK
I've been working on refactoring an old ASP.NET website (changed to web application) for a while now. To make a long story short, these changes have resulted in me replacing some CrystalDecisions references (since they were broken) with NuGet packages. One
of them is for
CrystalDecisions.CrystalReports.Engine. If you go to that web page, you'll see that it says, "This package has no dependencies.". Well, when I finally got it so that it would build, I thought I was done. Running it though and testing it proved otherwise.
The error I got is:
Message=The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception.
at timetrackreports.rpt_tt0002..ctor() in I:\WebSites\FPTimeTracker\FP Timetrack\timetrackreports\rpt_tt0002.vb:line 25
at timetrackreports.rb0002.MakeReport(ReportParameters ps, String ConnectionString, String EnvironmentString) in I:\WebSites\FPTimeTracker\FP Timetrack\timetrackreports\rb0002.vb:line 9
at ReportPrinter.Page_Load(Object sender, EventArgs e) in I:\WebSites\FPTimeTracker\FP Timetrack\TimeTrackSite\ReportPrinter.aspx.vb:line 29
Inner Exception 1:
FileNotFoundException: Could not load file or assembly 'CrystalDecisions.ReportAppServer.CommLayer, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.
At this point I did some searches and I found some posts on Stack Overflow that recommended installing the Crystal development environment on my dev machine. However, I also found a NuGet package for
CrystalDecisions.ReportAppServer. I'm wondering if I should pursue that or if I should instead install the Crystal dev environment? (Assuming we have a license for me to use and
I can figure out which version of Crystal this old app used.)
Mar 14, 2019 10:08 PM|PatriceSc|LINK
The old version still does work on a machine ? You could check which Crystal DLLs versions are installed there.
It's been a while but it likely still works the same way ie you have a "Crystal runtime" which needs to be installed and .NET assemblies are just to make its feature available from .NET.
Edit: for example https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads which seems to have downloads
for "redist" files (ie redistributable files aka runtime files).
Mar 15, 2019 02:07 PM|DoctorWho|LINK
I don't know if it works on my desktop (the other machine) or not. Today I'm working remotely, but I'll check that when I return to the office next week. Assuming that the Crystal DLLs are on the desktop, how do I determine what version is being used?
Mar 15, 2019 02:20 PM|PatriceSc|LINK
Try "File Properties" in Windows explorer and the "Details" tab :
It should show a file version and hopefully a product version information.
Mar 18, 2019 09:11 PM|DoctorWho|LINK
I'm surprised that I didn't think of this earlier. I'm at my office, working on my desktop. I've got VS 2017 open on this project. I'm looking at the history of the Web.Config file and see that even back when I first checked it into source control (the previous
guy hadn't bothered with version control), it was using CrystalDecisions.Shared and CrystalDecisions.CrystalReports.Engine version 13.0.2000.2. That hasn't changed since I checked it in 4 years ago, comparing it to what I'm working with now.
So, unless I'm mistaken, I think I might have, at least within the project the same CrystalDecisions assembly as the former developer used. I have looked around my machine; I don't have an installation of Crystal for development installed.