Current Position:Home > Keycodedecoder.dll failure still there in Crystal Reports 2010 SP1

Keycodedecoder.dll failure still there in Crystal Reports 2010 SP1

Update:11-30Source: network consolidation
I have a problem with getting an error that busineesobjects.licensing.keycodedecoder.dll not found for version 13.0.2000.0.
I am using Crystal Reports for Visual Studio 2010 Support Pack 1 (where I thougt this problem was resolved)
The exception does not show up by default but if I subscribe to the AssemblyResolve event I can see that the common language runtime tries to bind the keycodedecoder assembly and fails.
You can reproduce it by creating a .Net 4 windows forms project in Visual Studio 2010 and have Crystal Reports 2010 SP 1 installed. Here is the code for reproducing it:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Windows.Forms;
using CrystalDecisions.CrystalReports.Engine;
namespace CR2010error
  public partial class Form1 : Form
    ReportDocument doc = null;
    public Form1()
      AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(QFE);
    private void button1_Click(object sender, EventArgs e)
      doc = new ReportDocument();
    private Assembly QFE(object sender, ResolveEventArgs e)
      // Format of e.Name:  [name-without-exe-and-dll], Version=[version], Culture=[culture], PublicKeyToken=[key]
      Assembly assembly = null;
      string[] parts    = e.Name.Split(',');
      if (4 <= parts.Length)
        assembly = HandleSignedAssembly(parts[0].ToLower().Trim(), parts[1].ToLower().Trim(), parts[2].ToLower().Trim(), parts[3]);
      return assembly;
    private enum FailType { NoFail, FileNotExist, NoVersionInfo, QfeError, LoadError, };
    private Assembly HandleSignedAssembly(string name, string version, string culture, string keyToken)
      if (name.ToLower().EndsWith("xmlserializers") || name.ToLower().EndsWith(".resources"))
        return null;
      Assembly assembly   = null;
      string[] parts1     = version.Split('=');
      string   wantVer    = parts1[1].Trim();
      string[] parts2     = wantVer.Split('.');
      int      wantMajor  = Convert.ToInt32(parts2[0]);
      int      wantMinor  = Convert.ToInt32(parts2[1]);
      int      foundMajor = -1;
      int      foundMinor = -1;
      string   path       = CreateFullPath(name);
      string   exception  = "";
      FileVersionInfo fvi = null;
      FailType failType   = FailType.NoFail;
        if (!File.Exists(path))
          failType = FailType.FileNotExist;
      catch (Exception e1)
        failType = FailType.FileNotExist;
        exception = e1.Message;
      if (FailType.NoFail == failType)
          fvi = FileVersionInfo.GetVersionInfo(path);
          foundMajor = fvi.FileMajorPart;
          foundMinor = fvi.FileMinorPart;
        catch (Exception e2)
          failType = FailType.NoVersionInfo;
          exception = e2.Message;
        if (null != fvi)
          if (wantMajor != foundMajor || wantMinor != foundMinor)
            failType = FailType.QfeError;
              assembly = Assembly.LoadFrom(path);
            catch (Exception e3)
              failType = FailType.LoadError;
              exception = e3.Message;
              assembly = null;
      if (null == assembly)
        Message_SignedAssembly(failType, exception, path, name, wantVer, null == fvi ? null : fvi.FileVersion);
      return assembly;
    private void Message_SignedAssembly(FailType failType, string exception, string path, string nameOfDll, string wantVersion, string foundVersion)
      StackTrace st;
      StackFrame sf = GetOriginatingStackFrame(out st);
      string referredBy = "";
      if (null != sf)
        if (-1 != sf.GetFileLineNumber())
          referredBy = string.Format(msgSource1, sf.GetMethod().DeclaringType, sf.GetMethod().Name, sf.GetFileLineNumber(), sf.GetFileColumnNumber());
      string reason = "";
      if (failType == FailType.FileNotExist)
        reason = string.Format(msgReason1, path);
      else if (failType == FailType.LoadError)
        reason = string.Format(msgReason2, exception);
      else if (failType == FailType.NoVersionInfo)
        reason = string.Format(msgReason3, exception);
      else if (failType == FailType.QfeError)
        reason = string.Format(msgReason4, wantVersion, foundVersion);
      string msg = string.Format(msgBase1, referredBy, nameOfDll, reason);
      MessageBox.Show(msg, "QFE Resolver failed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
      MessageBox.Show("StackTrace: " + st.ToString());
    private string CreateFullPath(string name)
      if (name.EndsWith(".resources"))
        name = name.Substring(0, name.Length - ".resources".Length);
      return AppDomain.CurrentDomain.BaseDirectory + name + ".dll";
    private StackFrame GetOriginatingStackFrame(out StackTrace st)
      st = new StackTrace(true);
      StackFrame sf = null;
      for (int i = st.FrameCount - 1; 0 <= i; --i)
        StackFrame frame = st.GetFrame(i);
        string s = frame.GetMethod().Name;
        if (frame.GetMethod().Name == "QFE")
        if (null != frame.GetFileName())
          sf = frame;
      return sf;
    #region Message
    static string msgBase1 =
@"The program has failed to resolve a reference to a dll.
Referenced dll is
Reason for failing:
    static string msgSource1 =
Referred by
    static string msgReason1 =
@"The referenced file does not exist. Searched for file:
Copy the missing referenced file and retry again.";
    static string msgReason2 =
@"The referenced file cannot be loaded.
    static string msgReason3 =
@"Version information could not be obtained from the referenced file.
Recompile the referenced file and retry again.
    static string msgReason4 =
@"The referenced file is not compatible with the requested version.
The requested version was , but the found file has version .
According to the rules of QFE, these versions are not considered to be compatible.
Replace the referenced file with a compatible version and retry.";

The Best Answer

I am only having version 13 (SP1) installed on my computer.
If I run modules I can not see that crpe32.dll is loaded but there are fourteen other Crystal dll's loaded all with version 13 (from the below path)
c:\program files\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\
Yes I konw it's just a warning but it's really enoying and I think it's bad if you said all references to this keycodedecoder.dll has been removed in version 13 but this warning has been there in the beta version and the final version and now also in the SP1 version, and you have told us it has been fixed at least for the SP1 version.
I have tried my test project on a lot of other computers here at the company and we all get the same error so it's strange if you can't reproduce it. Can I e-mail you a zip-file of my test project or attach it in some way at this forum?
I am running a 32 bit version of Windows 7 with CRforVS_redist_install_32bit_13_0_1 installed.
Regards Tony
  • Keycodedecoder.dll failure still there in Crystal Reports 2010 SP1 Update:11-30

    Hi I have a problem with getting an error that busineesobjects.licensing.keycodedecoder.dll not found for version 13.0.2000.0. I am using Crystal Reports for Visual Studio 2010 Support Pack 1 (where I thougt this problem was resolved) The exception d

  • Crystal Reports 2010 SP1 on IIS 7.0 - Report is not being displayed Update:10-11

    Hi, Finally, the keycode assembly, BusinessObjects.Licensing.KeycodeDecoder.dll error is gone, after I installed Crystal Runtime 2010 SP1. Also, I tested Crystal Report 2010 SP1 on my Windows 32 application and I can tell that I do not have this erro

  • Invalid export DLL or export format" with Crystal Reports 2008 to Excel xls Update:10-11

    We are experiencing the same issue as reported in the sticky thread. I answered in that thread, but thought that I woudl open a new thread to keep track of this issue.  I can give you the responses to your questions you have requested in that thread:

  • Crystal Reports 2010 shows error on 64 bit vista/7 machines Update:10-11

    Hello, <br/><br/> I search the threads before posting my problem. I saw number of threads similar to this but none of them is pointing towards solutions to my problem. Thus decided to create new one. I tried various things listed in old post t

  • Crystal reports 2008 SP1 missing in BusinessObjects Crystal Reports website Update:10-11

    We have used Crystal reports 2008 as a reporting utility in our application and have released our product last year. During our release the latest software available  was Crystal reports 2008 base + SP1 + SP2 + Fix Pack 2.7 and same was mentioned in

  • Integrate the Crystal Reports 2008 SP1 with SAP R/3 Update:10-11

    Hi Experts, I have a requirement to integrate  Crystal Reports with the SAP R/3 . I'm new with this kind of integration and need help because I need to create a report based on the R/3 data. I have read some posts from this forum especially on the in

  • Regarding Crystal Reports 2013 SP1/SP3 runtime distribution clafrifications Update:10-11

    Hi, We are in process of migrating exsisting Crystal Reports from CR 2008 SP4 to CR 2013 SP1/SP3. Iam unable to find the corresponding msms for the same for runtime distribution (to install on end user Boxs). Can see latest as v. (_http:/

  • Detail sections not displayed with Crystal Reports 2010 Runtime (SP1 also) Update:10-11

    I have migrated a VB app from RDC 9 to Crystal Reports 2010 and I'm experiencing a very strange issue. In a report with 6 nested groups, the detail part is splitted in 7 section, and the whole detail has the "keep together" flag activated. At ru

  • Out of Memory issue in crystal report 2008 SP1 Update:10-11

    Hi ALL, I am facing serious issue in crystal report 2008 SP1. When i am click the page setup in crystal report 2008 ,it is prompting like "Out of Memory". Because  of this i am not able to see the default printer in the page setup. Please give t

  • Crystal Reports 2008 SP1 Install Error 1402 on Vista 64 Update:11-30

    I just downloaded and tried to install the Crystal Reports 2008 SP1 and when I try to run the setup I get a error 1402, could not open key error and the service pack rolls back.  I also tried to reinstall from my original CD and I not get the same er