dimanche 31 janvier 2010

An error has occurred while attempting to load Crystal Reports runtime


I was using .NET 1.1 framework and am currently migrating a web application to .NET 3.5 framework using Visual Studio .NET 2008.

I get the Crystal Report Runtime from Visual Studio .NET 2008 installation.

 
I use Crystal Report for PDF generation within the application.

In my application project, I reference dll of Crystal and set "copy local" to true. It works well on my machine.

But when I install the application on Server (Windows Server 2008, IIS7), I get the following error:

An error has occurred while attempting to load the Crystal Reports runtime.
Either the Crystal Reports registry key permissions are insufficient or the Crystal Reports runtime is not installed correctly.
Please install the appropriate Crystal Reports redistributable (CRRedist*.msi) containing the correct version of the Crystal Reports runtime (x86, x64, or Itanium) required.  Please go to http://www.businessobjects.com/support for more information.

If you encounter the above error, maybe the following solution could help.

- Check if Crystal Report Runtime is installed on server.
(If folder C:\Program Files\Common Files\Business Objects\ [version]\managed exists).
Otherwise install Crystal Report Runtime.

You can download Crystal Report Runtime from the following links:
 "CRRedist2008_x86.msi" (for 32bit)
 http://resources.businessobjects.com/support/downloads/redistributables/vs_2008/redist/x86/CRRedist2008_x86.msi


"CRRedist2008_x64.msi" (for 64bit)http://resources.businessobjects.com/support/downloads/redistributables/vs_2008/redist/x64/CRRedist2008_x64.msi

 - Check if Crystal is running on 32 bit server or 64 bit server. Go to your application project (in Visual Studio .NET), right click, and select "Properties".On the Build tab, find the Platform Target combo box. If Crystal runs on 32 bit server, change the Platform Target to x86 instead of Any CPU.

vendredi 22 janvier 2010

Unable to install or run the application. The application requires that assembly EnvDTE Version 8.0.xx be installed in the Global Assembly Cache (GAC) first.

I was working on a Winforms application that used EnvDTE library version 7.0.xx for Visual Studio automation. The application was developed using .NET 1.1 with Visual Studio 2003.

Recently, I was doing a migration of that application to .NET 3.5 with Visual Studio 2008.

I chose to deploy using ClickOnce deployment.

When I installed it on my machine, it worked. But then, I did a test with an end user machine without any Visual Studio .NET installed.
I got the following error:
Unable to install or run the application. The application requires that assembly EnvDTE Version 8.0.xx be installed in the Global Assembly Cache (GAC) first.

Then, I changed all references of EnvDTE 7.0.xx in my application with EnvDTE version 8.0.xx. I deployed it again to an end user machine.
But I still got the following error:
Unable to install or run the application. The application requires that assembly EnvDTE Version 7.0.xx is installed in the Global Assembly Cache (GAC) first.

I spent some time to fix the problem. But then I found an article in MSDN that helped me to solve the problem.
“This error is due to a runtime resolution conflict. The version on EnvDTE that is included with visual studio 2008 is 8.0.xx; but the project’s configuration reference is looking for an earlier version of this assembly, version 7.0.xx.
To fix this problem, you must add a binding redirect for that newer version of EnvDTE to your project’s configuration (.config) file.“

I then added to my App.config file the following configuration inside the “runtime” section.
I am now able to deploy the application to end user machines with success.

To learn more : 
http://msdn.microsoft.com/en-us/library/4eeya3de(VS.80).aspx