SAP Knowledge Base Article - Public

1336586 - Object reference not set to an instance of an object ... when building Visual Studio .NET 2008 web project

Symptom

  • Building a Visual Studio .NET 2008 web project 
  • Error Object reference not set to an instance of an object

Reproducing the Issue

  1. Create a new web project in Visual Studio .NET 2008.
  2. Add a Crystal Report to the project.
  3. Build the project.
  4. The error Object reference not set to an instance of an object is displayed.
  • Visual Studio .NET 2008
  • Crystal Reports 2008 SP1, with FixPack 1.5

Cause

The error is caused by a Crystal Decisions build provider in the web.config file

Resolution

  1. Open the web.config file in your project.
  2. Comment out, or delete, the following section:

<add extension=".rpt" type="CrystalDecisions.Web.Compilation.RptBuildProvider, CrystalDecisions.Web, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

Your <buildProviders> section should now look like this.

<buildProviders><!--<add extension=".rpt" type="CrystalDecisions.Web.Compilation.RptBuildProvider, CrystalDecisions.Web, Version=12.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>--></buildProviders>

For any version of the viewer change 12.0.2000.0 to the current version, for example 13.0.2000.0

Keywords

Object reference not set to an instance of an object , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , Problem

Product

Crystal Reports 2008 V1 ; SAP Crystal Reports, developer version for Microsoft Visual Studio