I have a Visual Studio 2005 ASP.Net Project which i upgraded to Visual Studio 2010 and am using .NET Framework 4.0 as target output.
All assembly referenced in my web.config are pointing to 4.0 assemblies
I have 40 to 50 crysral reports in this project as well
When i build my project it gives Build (web): Object reference not set to an instance of an object message in output window and compilation failes
When i re-compile couple of times, the project at last complies succsessfully
I tried upgrading the Crystal reports as well by editing them in VS2010 and save them with an upgrade, but the problem is still there.
After investigating in this issue i found that there was following construct in my <compilation> section of web.config:
<buildProviders>
<add extension=".rpt" type="CrystalDecisions.Web.Compilation.RptBuildProvider, CrystalDecisions.Web, Version=14.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
</buildProviders>
When i comment this section, compilation completes in first go:
Also if i add <clear/>, the problem goes away as well:
<buildProviders>
<clear/>
<add extension=".rpt" type="CrystalDecisions.Web.Compilation.RptBuildProvider, CrystalDecisions.Web, Version=14.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
</buildProviders>
I am unable to locate the root cause till now, if any one had this issue and a solution is there, please let me know, Thanks.