I am building a Web project using Nant. My Web application includes some Crystal Report files (.rpt and corresponding .cs file generated by Visual Studio).
I am embedding the rpt files as resource files using the <resources> tag for <cs> task.
The issue is some of my reports do not work and some works after I deploy the application. But the same report files works when I build the solution using VS.NET and deploy the application.
Some of the reports works fine without any issues but some reports gives the following error:
InvalidCastException: Specified cast is not valid.]
CrystalDecisions.Web.ReportAgentBase.m()
CrystalDecisions.Web.ReportAgent.get_RequestContext()
CrystalDecisions.Web.ReportAgent.get_()
CrystalDecisions.Web.ReportAgent.{(Boolean E)
CrystalDecisions.Web.CrystalReportViewer.OnPreRender(EventArgs e)
System.Web.UI.Control.PreRenderRecursiveInternal()
System.Web.UI.Control.PreRenderRecursiveInternal()
System.Web.UI.Control.PreRenderRecursiveInternal()
System.Web.UI.Page.ProcessRequestMain()
I tried adding the dynamicprefix="true" and prefix="WebUI" attributes (as suggested by Gret in one of the previous posts) to the resources tag but that doesn't help either.
When I overwrite the DLLs generated Nant with the DLLs generated by the VS.Net at the deployed site, all the reports starts working. That means that the output generated by the NANT is not correct for all the reports to run.
Please help!
Nitin Agarwal