Code Contracts and SAP CrystalReports 13


  • I'm using Visual Studio 2010 with Code Contracts 1.4.51019.0 and SAP Crystal Repots 13.

    When I enable Runtime Checking, I get the following error:

     Reading assembly 'CrystalDecisions.CrystalReports.Engine' from 'C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet\CrystalDecisions.CrystalReports.Engine.dll' resulted in errors.
                Assembly reference not resolved: BusinessObjects.Licensing.KeycodeDecoder, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304.
                Could not resolve type reference: [BusinessObjects.Licensing.KeycodeDecoder]com.crystaldecisions.common.keycode.KeycodeCollection.
    ccrewrite : error : Rewrite aborted due to metadata errors. Check output window

    I found out so far, that SAP have removed a number of DLLs from this release, because they are no longer using them. However, they still have references to these Assemblies. I found a number of posts in different forums, including SAP Support Forum, related to this issue and they all say that SAP won't release the KeyDecode assembly to the public.

    Is there any way to have ccrewrite ignore this error?


    Thomas Hoekstra

    Monday, November 19, 2012 2:44 PM

All replies

  • Actually, we do have an extra option to the rewriter to make it ignore metadata errors.

    In the CodeContract properties under Advanced, you can enter: -ignoreMetadataErrors

    This will cause the rewriter to continue even in the presence of such errors. Note that doing so is risky, as it might cause bad code generation in some circumstances. Use sparingly.

    Cheers, -MaF (Manuel Fahndrich)

    Saturday, April 13, 2013 12:42 AM