cancel
Showing results for 
Search instead for 
Did you mean: 

keycodedecoder.dll failure still there in Crystal Reports 2010 SP1

Former Member
0 Kudos

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 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()

{

InitializeComponent();

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;

try

{

if (!File.Exists(path))

failType = FailType.FileNotExist;

}

catch (Exception e1)

{

failType = FailType.FileNotExist;

exception = e1.Message;

}

if (FailType.NoFail == failType)

{

try

{

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;

else

{

try

{

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);

else

return;

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")

break;

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 .dll 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.";

#endregion

}

}

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

I am not able to reproduce the issue. What is the version of the crpe32.dll being loaded by your app? Use [Modules|https://smpdl.sap-ag.de/~sapidp/012002523100006252802008E/modules.zip] to check that.

BTW.; the warning does not affect any functionality of the app, nor does it cause any other errors...

- Ludek

Follow us on Twitter http://twitter.com/SAPCRNetSup

Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

Former Member
0 Kudos

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

former_member183750
Active Contributor
0 Kudos

It is not possible for the project to run and render a report without crpe32.dll being loaded. Check again and let me know the version of the crpe32.dll.

- Ludek

Former Member
0 Kudos

Hi

I have found the crpe32.dll in modules and the version is 13.0.1.220.

All versions of crystal dll's in modules have version 13.0.1.220 except for crdb_adoplus which has 14.0.2001.220 and crdb_adoplus_res_sv which has version 14.0.1101.220

/Tony

former_member183750
Active Contributor
0 Kudos

That all checks out.

I did a brand new install of vs2010, then crvs2010 RTM.

At this point I see the warning error in the event viewer

Then I applied crvs2010 SP1 and no more keycode errors. Ran a Win and a Web project.

It may be an idea to remove any traces of crvs2010 from the computer and install [SP1|http://www.sdn.sap.com/irj/boc/support?rid=/webcontent/uuid/d01fdad8-44e5-2d10-61ad-9d2d4158f3a8] [original link is broken]; of crvs2010

right away after that. To remove crvs2010, follow the directions in [this|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333533333335333333323335%7D.do] KBase (it is written for Beta 2, but all will be the same for RTM).

- Ludek

Former Member
0 Kudos

Hi

Now I have bought a brand new computer and the only programs I have installed is:

Windows 7 64 bit Operating System

Microsoft Visual Studio 2010

Microsoft Visual Studio 2010 SP1

CRforVS_redist_install_64bit_13_0_1

CRforVS_redist_install_32bit_13_0_1

Then I run my project and I still get the exakt same error.

Can I upload my source code somewhere so you can test it or can I e-mail you the source code if you give me your e-mail address?

Regards

Tony

Edited by: wmtoped on Apr 29, 2011 3:43 PM

former_member183750
Active Contributor
0 Kudos

Sharing of apps \ files \ etc., is normally only done for phone support cases. Phone support can be obtained here:

http://store.businessobjects.com/store/bobjamer/en_US/pd/productID.98078100?resid=S6I@hgoHAkEAAGsiyV...

For more details see the blog [What are these 'support' forums good for anyhow?|/people/ludek.uher/blog/2011/04/07/what-are-these-support-forums-good-for-anyhow]

- Ludek

Answers (0)