Crystal Reports for .NET 4.0

by Victor 28. December 2010 23:10

Recently, I upgraded a Windows Forms project from .NET 3.5 to .NET 4.0 (VS2008 -> VS2010). Everything worked fine until I tried to view a Crystal Report. A little research led me to discover that Crystal Reports is not shipped with Visual Studio any longer, so first you have to download it from here. Good, now everything should work, right? Not in my case. The report in question uses a .NET class as it's datasource. In other words, it's using the ADO.NET data provider. So I get this informative little error message:

Could not load file or assembly 'file:///C:\Program Files\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet1\crdb_adoplus.dll' or one of its dependencies. The system cannot find the file specified.

After a little reasearch, I found in the Release Notes for CR, that

"A report based on an ADO.NET DataSet will not work if the project targets the 4.0 .NET Framework"

As a workaround, add following part into app.config or web.config files:

<startup useLegacyV2RuntimeActivationPolicy="true">
  <supportedRuntime version="v4.0"/>
</startup> 

That did the trick for me. Now everything's dandy again.

Tags: , ,

Crystal Reports

                 

Comments (21) -

1/29/2011 11:03:51 PM #

saeed

Pakistan (The country)
It was nice to see and look around here.
It worked. Thanks for the post.

saeed

2/1/2011 1:39:35 AM #

Victor Ponce

Thanks saeed. Glad to contribute to the ever growing community of developers.

Victor Ponce United States

4/25/2011 7:09:55 PM #

mohammed

thank you

know it is work !

Regards

mohammed Saudi Arabia

6/9/2011 12:08:20 PM #

Nik

I am using SAP crystal report. on compiling i am getting this kind of error.
The type 'CrystalDecisions.Web.CrystalReportViewer' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\CrystalDecisions.Web\10.2.3600.0__692fbea5521e1304\CrystalDecisions.Web.dll' and 'c:\WINDOWS\assembly\GAC_MSIL\CrystalDecisions.Web\13.0.2000.0__692fbea5521e1304\CrystalDecisions.Web.dll'  

Nik

6/18/2011 5:18:04 AM #

Johnette Bonilla


Thank you for this wonderfull blog

Johnette Bonilla United States

6/22/2011 10:19:58 PM #

Pandranol


Thank you for your post

Pandranol United States

7/27/2011 1:47:19 AM #

Victor Ponce

@Nik - sounds like you have references to multiple versions of Crystal Reports. Try removing one from the project references and the web.config

Victor Ponce United States

10/26/2011 1:01:36 AM #

Nguyễn Duy Nh&#226;n

Thank's very much ! (Cảm ơn bạn nha Vector)

Nguyễn Duy Nhân Vietnam

12/31/2011 6:43:18 PM #

fateme

I LOVEEEEEE YOUUUUUUUUUUUUU!
You solve my problem Smile
thanx , thanx thaaaaaaaaaanx.
A BIG KIIIIIIIIS For YOUUUUUUUUUUUUUUUUUUUUU

fateme Iran

1/10/2012 9:35:30 PM #

Al Shaqsi

Thanx alot.  You are superman coz solved my problem  

Al Shaqsi Oman

1/19/2012 12:03:49 AM #

luis588

Thank you very much !

luis588 Costa Rica

7/8/2012 1:11:52 AM #

RUTH SILVA SEGURA

hola tu me podrías decir en donde encuentro el archivo config para colocar ese código? te lo agradeceria muchísimo.

RUTH SILVA SEGURA Colombia

7/8/2012 6:24:24 PM #

Victor Ponce

@Ruth - En el app.config o web.config, dependiendo en el tipo de proyecto

Victor Ponce United States

7/10/2012 4:11:17 AM #

RUTH SILVA SEGURA

Victor -no es web. pero necesito saber es donde encuentro el fichero app.config si es el visual o porque en el SAP Bussines no esta.
te agradezco mucho la colaboración.

RUTH SILVA SEGURA Colombia

7/10/2012 11:44:14 PM #

Victor Ponce

lo siento pero no se de donde se encuentra el fichero en SAP Business

Victor Ponce United States

7/11/2012 12:44:40 AM #

RUTH SILVA SEGURA

lo que necesito es la ruta para encontrar el app.config quien me puede ayudar por favor.

RUTH SILVA SEGURA Colombia

7/11/2012 12:50:41 AM #

Victor Ponce

no vas a encontrar "app.config". buscar "otra_cosa.config"

Victor Ponce United States

7/14/2012 2:46:24 AM #

RUTH SILVA SEGURA

si. pero donde...xD!

RUTH SILVA SEGURA Colombia

12/20/2012 12:07:09 PM #

Roger

Thank you very much. You are a crack.

Roger Spain

12/20/2012 12:34:56 PM #

Roger

Si el archivo app.config no lo tenemos en nuestro proyecto lo podemos añadir de la siguiente manera:

-Abrimos nuestra solución con el visual studio
-Botón derecho - sobre el proyecto y le damos a propiedades
-Le damos sobre la pestaña configuración.
-Si no recuerdo mal aparece la opción de añadir archivo de configuración.

Roger Spain

5/20/2014 4:49:41 PM #

Chat Line

A person essentially assist to make critically posts I might state. That is the very first time I frequented your web page and to this point? I amazed with the research you made to create this actual post extraordinary. Excellent job!

Chat Line United States

Pingbacks and trackbacks (4)+

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Powered by BlogEngine.NET 2.5.0.6

About Us

Wuji Touch is a software consulting firm based in Delray Beach, Florida. We specialize in Microsoft technologies, but we also have experience with Progress OpenEdge, iOS, and Android development. This is our blog. These are the tales of the pains and pleasures we experience daily in our journey through 1s and 0s.

Month List