CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Peter's Gekko

public Blog MyNotepad : Imho { }

Get your Crystal report working on your customers server (Cannot find KeycodeV2.dll, or invalid keycode)

Actually I do like Crystal Reports. It may not be perfect but the way it works with datasets, its grouping a selecting options and the web report viewer are very workable. Deploying Crystal Report to a web server is another story.

When you test your app on your localhost all seems to be working well but when the app is installed on the webserver it produces the notorious Cannot find KeycodeV2.dll, or invalid keycode error message. The Crystal site has loads on support on that which tells you to update some registry settings. There is a big chance that you will not find these settings. What to do next is hidden a lot better in the docs.

The crystal viewer uses a couple of dll's which are installed on your development machine. They are part of CR for VS.NET but not of the .NET framework. If there is no vs.net installed on the webserver these files will be missing on the server. A deployment project in VS.NET will not see the dependencies and will not include them in the setup. What worked for me (destilled out of the loads of CR docs) was creating a setup project with a couple of merge modules

  • Crystal_Database_Access2003.msm
  • Crystal_Database_Access2003_enu.msm
  • Crystal_Managed2003.msm
  • Crystal_regwiz2003.msm
  • VC_User_CRT71_RTL_X86_---.msm (used for reports based on ADO.NET)
  • VC_User_STL71_RTL_X86_---.msm (used for reports based on ADO.NET)

The regwiz module has an License key property, here you enter the Crystal license key found in the help about of VS.NET. It will read something like AAP50-GS00000-U7000RN.

Installing this dummy app will enable CR in all your webservers applications. On one server the setup was a webapp, on another server we had to create a Windows forms setup before the server would see CR.

Blog on, Peter


Published Jan 06 2004, 09:00 AM by pvanooijen
Filed under:

Comments

Gr8 said:

Really cool man....Thanks
# February 6, 2004 10:46 AM

Peter's Gekko said:

Exporting from Crystal Reports to PDF, Word, Excel and HTML
# February 10, 2004 8:36 PM

te said:

<script>Good script</script>
# February 18, 2004 10:24 AM

Sasha said:

This is fantastic, resolved the problem that I had for more that a year. Thanks
# March 11, 2004 8:25 AM

imtiaz said:

i have same problem
cannot find keycodev2.dll or invalid keycode
plz help me
and tell me how can i register or set .msm
files on client
# March 17, 2004 5:15 AM

Peter van Ooijen said:

# March 19, 2004 2:06 AM

Biswajit Jena said:

Hello,
In VB.NET my crystal report is not working in client machine.

Please give me the detail informations.

Regards
Biswajit
# March 20, 2004 4:10 AM

Peter van Ooijen said:

This story deals with CR on an asp.net server, client side is another story.
# March 21, 2004 12:00 PM

imtiaz said:

i have made deploy packege and added modules with merge module option the modules are

crnetruntime.msm
license.msm
mapping.msm
reportengine.msm
VC_User_STL71_RTL_X86_---.msm
VC_User_MFC71_RTL_X86_---.msm
VC_User_CRT71_RTL_X86_---.msm
VC_User_ATL71_RTL_X86_---.msm

and I have run setup on server machine but still same error
comming

Cannot find KeycodeV2.dll, or invalid keycode
plz any one help what can I do
# March 24, 2004 3:53 AM

Peter van Ooijen said:

You're using a different set of msm's.
Did you check registration ? Of the setup package and in the registry ?
# March 24, 2004 4:12 AM

Ben said:

Thanks a TON! Error Fixed.
# March 26, 2004 1:10 PM

Prashanth said:

Thanks a lot.. Working without any problems.
# April 10, 2004 5:45 AM

Kavita said:

Hi,

We have developed a .net application in C# and VB.NET (Visual Studio 2003). when we install the Application on a Tablet PC with Operation System Windows XP, the reports which have even one subreport are not working with the error "Object Reference not set to an object".
We are using the ReportViewer component of .net. We tried creating the install of the Application with both Visual Studio Set up projects and also with Installshield express.

When we installed our application first, we got keycodev2.dll error and that has been resolved and after that we are getting this problem.

We also used the latest Crystal Report merge modules and compared the DLLs using Modules.exe from Crystal Report Site in 2 scenario - one while running the Application from Visual Studio on the tablet PC when the reports work properly and the other one with the installed exe created from the same source which is working on the same tablet PC. The number of Dlls are more when the Application runs from the installed exe but all the dlls in use in the other scenario are present here. We checked the versions of dll also in both the cases and they are same.

Please suggest what to do.

Thanks in advance.
Kavita
# April 14, 2004 2:15 PM

Peter van Ooijen said:

My experiences are limited to running Crystal on a web-server. Did you check the other thing s?
http://dotnetjunkies.com/WebLog/petergekko/archive/2004/02/24/7846.aspx
# April 16, 2004 2:37 AM

Vikul said:

Can anybody tell after all these problem is it possible to install an application in .net on client machine without any error like Keycode.dll.

Thx

With Gr8 Regards

Vikul
# April 21, 2004 12:38 AM

Peter van Ooijen said:

The original post concerns web-apps. Once fixed (on the web server) it's fixed for all clients. Once fixed for one web-app it's fixed for all webapps.

It's an overkill to include the the assemblies in the setup of every web-app. To big (> 10 mb)

Some day I'll look at running Crystal in a Windows .net app.
# April 21, 2004 5:31 AM

Phil said:

There are different sets of MSM files depending on whether or not you are using the full versions of Crystal Reports, or the embedded version in VS .NET.

The following pdf has all the information you need:
http://support.businessobjects.com/communityCS/TechnicalPapers/crnet_deployment.pdf
# April 21, 2004 8:58 AM

Peter's Gekko said:

Wikis on the dotnetjunkies ?
# April 26, 2004 10:10 AM

Tzury Bar Yochay said:

Couldn't Crystal Creators write it in a descriptive way in thier support KB as Peter?
# April 28, 2004 2:34 PM

Peter van Ooijen said:

Thanks Tzury. Keeps me of the streets :>
# April 28, 2004 2:48 PM

Tzury Bar Yochay said:

Couldn'r Business-Objects write it as descriptive and detailed as this one?

The rule is: With third-party controls you mostly need third-party developer for troubleshooting.

PETER - THANK YOU VERY MUCH.
# April 28, 2004 2:55 PM

Tom Shokite said:

I still can't get Crystal running on target machines as the very frustrating "Cannot find KeycodeV2.dll, or invalid keycode" keeps appearing. I've even tried to copy about 20 registry keys, from my development machine to the target machine and that still did not work. Installing VS.NET on the target machine is now the only way I can use Crystal. So I simply resorted to not using Crystal and now at least my application works and to hell with Crystal. I will look for another way to get out the reports. Adobe's Acrobat, which I used to use when I programmed with C++, did work. I'm programming utilizing C# and Window Forms. tshokite@comcast.net :(
# May 2, 2004 10:01 PM

Tom Shokite said:

Well I have an update. After trying, and I mean many times, I finally got it to work. Seems I have been running on an older version of Visual Studio .Net, from an install off of the MSDN site (subscriber), but it was an older version. I removed that older version completely and reinstalled the latest version of Visual Studio.Net. Then I downloaded the following writeup from: http://support.businessobjects.com/communityCS/TechnicalPapers/crnet_deployment.pdf
It is very well written and holds your hand throught the process (forget the other documents on the internet as they kind of waist your time and are incomplete) :)
# May 11, 2004 7:42 AM

Dave M said:

THANKS BUDDY! Top shelf help!!
# May 20, 2004 10:31 AM

Sebastien said:

I have made an application in Visual Basic.net that uses Crystal Viewer to run some reports. I have no problem running the application on the machine where it has been developped or any machine that has Visual Basic.NET and Crystal Report 9 installed.

But when I tried to deploy my app on a computer without Crystal Report 9 and only the right Framework, I had a TLV Record Error. I am using Crystal Report 9 and i have included the merge module that Business Object give :
Crystal_Database_Access2003.msm
Crystal_Database_Access2003_enu.msm
Crystal_Managed2003.msm
Crystal_regwiz2003.msm

I still have the same problem. I thought it might be because i'm missing these 2 modules event thought i'm not sure i need them :
VC_User_CRT71_RTL_X86_---.msm (used for reports based on ADO.NET)
VC_User_STL71_RTL_X86_---.msm (used for reports based on ADO.NET)

But i can't find them and now my app needs to be delivered... it's getting quite urgent.
What to do? Help me please!!
# May 21, 2004 12:16 PM

Peter van Ooijen said:

It is a mess. There are several version of CR, several versions of the framework and there is web-based CR versus a Winform based.
I have managed to get the CR which comes with VS.2003 to work on a web-server. And I know that the solution for all other combinations is different...
# May 26, 2004 3:51 AM

Patrick said:

I'm running into the same problem, and I'm using the references version 9.1.5000.0 from crystal decisions in my solution, I'm using VS 2003 and the framework 1.1.
# May 26, 2004 9:47 AM

Alan said:

can anyone provide me with a simple vs.net solution containing a winform app with a crystal report and a setup project? I have installed a clean xp with just .net framework and i keep getting the keycodev2.dll error even though i put in the key in the merge module and followed that crnet_deployment.pdf document. thanks.
# May 26, 2004 3:20 PM

rtrtr said:

haleluza
# May 26, 2004 11:33 PM

haksin said:

i have not find these .msm in my computer.
i am using .net2002
plz. help me
# May 27, 2004 6:49 AM

Peter van Ooijen said:

Haksin, Switch to 2003. Then you'll be in the same mess as everybody else :>
# May 29, 2004 1:46 PM

Srinath said:

hey
iam trying to do some the same, trying to deploy a vb.net system to the client side.
every one tell the same add the 4 or 5 files as above.
i have one small problem Crystal_regwiz2003.msm does not have a license Key property can any one help me srinathk7@hotmail.com
# June 3, 2004 1:01 AM

Srinath said:

hey
iam trying to do some the same, trying to deploy a vb.net system to the client side.
every one tell the same add the 4 or 5 files as above.
i have one small problem Crystal_regwiz2003.msm does not have a license Key property can any one help me srinathk7@hotmail.com
# June 3, 2004 1:03 AM

Alan said:

Srinath, its in the properties window after you include it in your setup project and expand the mergemoduleproperties. Let me know how it goes cause i could never get my winform app to work even after i installed a clean xp with just .net.
# June 3, 2004 4:21 AM

Guru said:

Hi Peter, and thanks for the magic tip. I had to resort to the second option (installing a dummy Windows Form App with the reqd. CR modules).
My quirk : if CR and VS.net are so tightly integrated WHY can't that &*#$ regwiz.msm pick up the 19-digit itself?
Anyway, thanks for the info, especially for putting it concisely and lucidly unlike most obfuscated CR documents available.
Cheers - Guru.
# June 5, 2004 9:29 PM

Peter van Ooijen said:

Thanks.
I beleive the integration to be only skin-deep. It is tough skin with a lot of wrappers but I'm not sure about what's inside. Lots of COM ?
# June 8, 2004 4:22 AM

Jonathan Miller said:

This finally fixed my problem! Thanks again!
# June 10, 2004 11:32 AM

Jai Sevin said:

I ran into this problem..and finally got it to work on our test server.. But now I'm getting the error when trying to put into production. I'm using the same dummy web app to install the merge modules that i used in test on our production server but no dice..is there any other things I can look for
# June 23, 2004 11:05 AM

Nadeem said:

I have successfully installed VB.NET and Crystal report on my machine , now when I add the crystalreport.rpt from the add item option it doesn't work, nor does it shows any error. Please help me in this.
# July 7, 2004 6:20 AM

Beti said:

after adding registration number and all merge modules I do still have the same error:

Cannot find KeycodeV2.dll, or invalid keycode

What else, please?
# July 8, 2004 7:15 AM

Dean Stelow said:

Excellent advice. Thanks.
# July 16, 2004 3:01 PM

If All Else Fails Look at the Machine.config. All said:

Had the same Problem.

Solution: In the Machine.Config(C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG)file
Under the TAG <processModel ... />
Change the Username to "System"

Why?
Allows the Process to access all of the Registry Settings...



# July 29, 2004 5:33 AM

Sinan Sonmez said:

Windows form setup worked fine on my Web Application... Thanks for the help, remember to enter the Licence Key for regwiz2003

Modules I've included are :

Crystal_Database_Access2003.msm
Crystal_Database_Access2003_enu.msm
Crystal_Managed2003.msm
Crystal_regwiz2003.msm
VC_User_CRT71_RTL_X86_
VC_User_STL71_RTL_X86_

thanks for the help mate, saved my life
# July 29, 2004 2:06 PM

Matt (Frustrated) said:

Heres one for you guys ( and gals). Built a db access prog in vs.2003, coleague developed a viewer for it in c# goes into project fine, runs on development network OK. The got keycodev2.dll error, included merge module now it can find the dll, however, its now telling me it can't find an available license. I've looked for the license key property in the regwiz.msm but I can't find it. Anyone help????
# July 30, 2004 5:35 AM

Matt (Frustrated) said:

Just found a little help file may be of use. PDF format http://support.businessobjects.com/communityCS/TechnicalPapers/crnet_deployment.pdf
# July 30, 2004 5:42 AM

Zandi Zungu said:

I created the deployment package using the correct merge module and entered the correct license key, however, I still had the same error "Cannot find KeycodeV2.dll, or invalid keycode"
I've checked that my assemblies are all of the same version and also unregistered and re registered various dlls including keycodev2.dll but it did not solve my problem.
The ultimate solution was installing Crystal on the server where I'm trying to deploy my web application. This works! Consumes space but at least it works!



plz any one help what can I do
# August 12, 2004 7:14 AM

Zandi Zungu said:

I created the deployment package using the correct merge module and entered the correct license key, however, I still had the same error "Cannot find KeycodeV2.dll, or invalid keycode"
I've checked that my assemblies are all of the same version and also unregistered and re registered various dlls including keycodev2.dll but it did not solve my problem.
The ultimate solution was installing Crystal on the server where I'm trying to deploy my web application. This works! Consumes space but at least it works!



plz any one help what can I do
# August 12, 2004 7:18 AM

Wayne Russell said:

I have created web install project has you have suggested but how do I deploy on server with only ftp access
# August 21, 2004 2:58 AM

Peter van 0oijen said:

Ftp the msi to the sys-admin ? :>
I think you (or someone else) has to run the installer on thr machine, I wouldn't trust xcopy deployment to do the job her.
# August 21, 2004 3:14 PM

Bruce Tank said:

I have tried to create my own merge module project and add these files, so I would have just one merge module for my deployment package.

No dice.

The funny thing is that the merge module properties are NOT exposed if these are in a merge module project. The properties DO get exposed when they are in the deployment project, rather than the merge module project.
# September 17, 2004 9:24 AM

Kundan said:

Hey man !

Your suggestion really worked wonders !

The problem is solved on my machine too...

Great Going ....

Thumbs Up !

Kundan
# October 1, 2004 8:27 AM

Kristina P said:

Solution worked for me also, just adding the gotchas that caught me as a newbie to this IDE.

At first I didn't understand "create a setup project" but I found it - New Project, and choose Setup/Deployment type. Also I got the dreaded "Licence Key cannot be nullable" but could not find where to set it. Turns out the View window for the solution (which lists the merge modules) was off. When I turned it on from the View menu, and clicked the + sign next to properties, I found it.
# October 7, 2004 10:17 AM

martin said:

Ping Back??:blog.csdn.net
# October 12, 2004 4:50 PM

Kristyn said:

Super tip easiest most straight forward fix I have seen in a real long time!!!! Thanks
# October 13, 2004 11:01 PM

Peter van 0oijen said:

You're welcome :)
# October 14, 2004 6:22 AM

Somayeh said:

hi,
i have the same problem but my app is not webapplication it is windows application..will this solution work for windows application too??
please help me!
# October 24, 2004 1:16 AM

Peter van 0oijen said:

CR on Windows is comparable but does work different. I think your windows setup needs a CR setup. But I don't know what goes in there.
# October 24, 2004 3:03 PM

Loren & Pablo said:

hi
we only want to say THANKS A LOT for the solution.
you save our lives.
we were trying to fix this problem with the reports the whole week.

thanks again.
# October 27, 2004 10:23 PM

Adamo said:

I've followed all the solutions on this page but I still get the "cannon find keycodev2.dll" error. I am trying to deploy to my web server. I copy the files from my local machine to the wwwroot folder on the server. I've included the setup project the msm files. I have .net framework 1.1 installed on the server. Any help is appreciated.

Thanks
# October 28, 2004 9:29 AM

Raj said:

Hi this discussion board was a lot helpful since i had the same issue. Can we prompt the user to give the license key?. ie the key should be give dynamically.. plz help
# November 5, 2004 2:29 AM

Peter van Ooijen said:

I don't think so. Apart from the technical side. The license key is your license which comes with VS. It's not the users license.
# November 8, 2004 1:32 AM

Web development said:

You're wanderful, I tried many solutions neither worked till I got this solution. Thanks a lot.
# November 27, 2004 1:59 PM

Venky said:

Thanks and it helped me a lot
venky
# November 29, 2004 11:03 PM

Rui Santos - Portugal said:

Just a note for everybody who haven't solved the problem yet:

let's say your license key is
AAP50-GS00000-15M00FS

don't forget to remove de "-"'s

ex: AAP50GS0000015M00FS

this was the solution for my problem.. a bit lame i might add..
# December 3, 2004 5:04 AM

Victor Ramírez said:

This is a killer tip!.. Thanks
# December 28, 2004 8:52 AM

Ronnie Kleinfeld said:

Thanks,
I've been working on this for at least 1 week
That just a great idea you have here

Ronnie
# January 6, 2005 1:08 AM

Mike said:

Excellent , solved an issue I had
Thanks
# January 13, 2005 8:59 AM

Himani said:

Hi Peter
I am having a web application built with microsoft visual studio.net 2003 having crystal reports for visual studio .net 2003.
On running the application at the production server,the report viewer object does not show the refresh button, the Goto page button ,and all the images as ole objects have vanished.

Why is this so??
# January 21, 2005 1:21 AM

Peter van Ooijen said:

hi,

hard to say exactly but it smells like a registry problem. The ole objects not being registered properly.
# January 21, 2005 7:15 AM

Himani said:

one more question peter,if my production server already has web applications installed in them with the correct license key,and when i go to install a new application if i specify the wrong license key,will my application show the crystal report correctly.The reason why i ask this is that my understanding says that the merge module license key only installs the correct version of crystal dll in the gac,so if its already done due to previous applications running (Which were bult using the same crystal reports version)on the same server.
Another question is what if i move my installed application folder to say another drive say D: drive.What will happen in that case ???wrt to crytal reports ??
# January 21, 2005 11:23 PM

Peter van Ooijen said:

My suggestion is to build a CR deployment package independent of your apps. Needed once So Asp. NET (and all your apps running on that) have CR.
CR installment is independent of your apps. When CR works in one app and not in another you are dealing with another problem. When you move your app to another drive you'll have to inform ISS where it has gone. The virtual dir mappings should be changed.
# January 22, 2005 3:58 AM

sunny said:

Hi guys and girls
i cannot run crystal report on client machine. Whenever i try running it it gives me error which is the same one as above. I tried running regwiz but no good...can there a solution to this..pls let me know....
sunny
# January 28, 2005 6:28 AM

harsh said:

if any one can help me then plz sed the solution
thanks in advance for giving your valuable time.
# January 31, 2005 2:25 AM

Peter van Ooijen said:

# January 31, 2005 7:32 AM

Peter van Ooijen said:

This post, the comments and the links. That's "all" there is :)
# January 31, 2005 7:33 AM

Neil Jefferson said:

I hope someone can give me a clue why the keycode error occurs when accessing a report through a Citrix frame server. The report runs fine when using the server directly but fails through the terminal viewer.

Any ideas where to start? The preceeding comments were an enormous help in getting this far.
# January 31, 2005 1:37 PM

Peter van Ooijen said:

It is a Citrix problem :)
Wild guess: Citrix makes Window search for dll's on the client PC instead of the server ?
# January 31, 2005 2:15 PM

Ming Lam said:

Its great and very helpful, Thanks!
# February 15, 2005 6:11 AM

Aravindan.N said:

Hi,
This archive is highly informative.
Thanks dude.
Keep going...
# February 25, 2005 11:24 AM

Prajakta said:

I tried with creating setup project to solve the same problem. But still not working. It is giving as error as:

Parser Error: File or assembly name CrystalDecisions.Web, or one of its dependencies, was not found.

Plz tell me the procedure to upload setup project on web server. i think i m missing something while uploading, or is it any other problem?

Plz Do Help Me.
# March 2, 2005 12:44 PM

Peter van Ooijen said:

I lack the supernatural powers to monitor your uploads. I'm sorry :/
# March 3, 2005 6:06 AM

Guillermo desde Bolivia said:

Thanks Peter! Error Fixed.
# March 15, 2005 3:06 PM

Madhavi said:

We have done the setup as you suggested. But still it is giving the same error. Deployment machine has .net framework 1.1 and crystal reports 9.2 installed. We are using Visual Studio 2003 for creating the setup. Please help in solving this problem.
# March 31, 2005 10:33 PM

Pradeep Kotwal said:

Hi...
I still can't get Crystal running on target machines as the very frustrating "Cannot find KeycodeV2.dll, or invalid keycode" keeps appearing. Client M/c has VS.NET 2003 and Crystal Report 10.0 Trial Ver. Installed. How can identifing the Installed component (specially CR Ver) on Target m/c.
# May 3, 2005 5:42 AM

pvanooijen said:

This solution is specific to the CR which comes with VS 2003. Every cr is different. Instead of looking at the CR 10 trial I would consider sql reporting services.
# May 3, 2005 12:14 PM

sridhar said:

Great Article Solved a big issue. the issue seems to be regading Keycode and everybody looks in REGEditor, but this article solved my problem..
thanks once again..
# June 7, 2005 12:34 AM

Burkni said:

Thanks a lot, I am using Windows Forms and the regwiz2003.msm seems to have been my problem. Mind you, it can conflict with license.msm (which seems to do exactly the same thing) but if license.msm is added after regwiz2003.msm, it seems to work :)
# June 10, 2005 3:06 AM

Risto Krulj, Belgrade, SCG said:

Thanks, man! This resolved my problem!!
# June 13, 2005 1:10 AM

Rebecca said:

This issue plaged me for several days on a Win2003 system.

The solution ended up being giving "EVERYONE" read permissions on the folder C:\Program Files\Common Files\Crystal Decisions\1.0\bin where the keycodev2.dll file resides.

Cheers.
-R.
# June 14, 2005 8:11 AM

Chris said:

Peter

Can you shed some light on what to do with the dummy app ? I created one as a project within my solution, re-built and copied the dll back but still the same issue. Does the dummy app need to be created separately from the solution, if so where should it be put on the webserver, in the root ?

Thanks
# June 15, 2005 5:52 AM

Fred said:

Rebecca,
I'm getting this issue at windows server 2003 too, can you give me more detail please? somebody said the user is NETWORK SERVICE instead of ASPNET here... thanks.
# June 24, 2005 9:32 AM

Anita said:

I have tried every single suggestion in this blog and I still get the same keycode message.
Here is a list of things I tried:
installed the crystal components using merge modules including the regwiz2003 module with the license key (I tried with and without dashes)
tried to suggested change to the machine.config file
plus I tried every single thing businessobjects posted for this problem (e.g. registry permissions)
I'm trying to do this on the 2003 server, the app was developed on XPSP2. I am using the bundled version of CR with VS2003.
I am about to tear my hair out, it is so frustrating. Anyone has any other suggestions that may work?
# June 24, 2005 3:52 PM

Anita said:

Forget my previous post. Finally I got it working! For some unknown reason I had an extra 1 in the beginning of the keycode. I knew it had to be something this dumb! Grrrr!
# June 24, 2005 4:13 PM

Mendy said:

Is there a way of getting crystal to work on a web hosting site. The site doesn't have CR and they won't run an install file for me. I'm trying to just copy the files over but I'm still getting the keycode error message.

any help would be greatly appreciated,
Mendy
# July 19, 2005 6:49 AM

pvanooijen said:

There is no way to CR running without fiddling on the hosting server. Just copying files is not enough.