问题
I have a application with lot of reports using crystal reports.Now I want to setup and deploy my Project using visual studio setup wizard.But my problem is I want to install the application on another computer which has not installed the crystal report.The application run perfectly until it reaches the report part,it throw an error 'The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' throw an exception'.
How do I reference crystal report dependencies on my setup project any body have idea ?
回答1:
To this You need to instal crystal report run time engine in that machine. In VS2010 they separated crystal reports from visual studio. So this problem is coming.
回答2:
- Right Click on Project(Setup and Deployment) which you created.
- Select Properties then click on Prerequisites button
- Checked option ' Crystal Report for the visual studio'
- then click on ok button
回答3:
you can add add this references to your project:
1-CrystalDecisions.CrystalReports.Engine.dll
2-CrystalDecisions.Enterprise.Report.dll
3-CrystalDecisions.ReportSource.dll
4-CrystalDecisions.Shared.dll
5-CrystalDecisions.Windows.Forms.dll
6-CrystalKeyCodeLib.dll
来源:https://stackoverflow.com/questions/19465170/crystal-report-integration-issue-on-setup-and-deployment