Hello,
for an application I need to check the availability of Crystal Reports runtime libraries. What I've tried is:
void CheckCrystal()
{
try
{
CrystalDecisions.Windows.Forms.CrystalReportViewer test = new CrystalDecisions.Windows.Forms.CrystalReportViewer();
test.Dispose();
}
catch (System.Exception)
{
PTrace.Error("Some dependences needed to run Crystal Reports are not available.");
throw;
}
}
This is not working because the File.IOException about the missing Crystal dependency is thrown in the method that calls CheckCrystal before calling the method. Is like .Net knows that it will need the assembly before needing it. Is this true? How can I change this behaviour?
Thanks in advance.