.net – Crystal Reports Problem with .net 4

crystal-reportsnet

I've worked with Crystal Reports in .net 3.5 before, but since upgrading to .Net 4.0 I'm facing this error:

" Error 5 The type or namespace name 'CrystalDecisions' could not be found (are you missing a using directive or an assembly reference?) C:\Users\aligoglos\Documents\Visual Studio 2010\Projects\WPF\ReportTest\ReportTest\CrystalReport1.cs 14 11 ReportTest "

I installed Crystal Reports for Visual Studio 2010, but my error is still unresolved.

Thanks to all.

Best Answer

If you have SAP Crystal Reports, version for Visual Studio 2010, here's what you have to do:

When using ADO.NET with the Microsoft .NET Framework 4.0, the following setting must be added to the application’s configuration file:

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

I got this information from a PDF on Crystal Reports from here:

http://www.sdn.sap.com/irj/sdn/index?rid=/library/uuid/e06b8953-a62b-2d10-38b9-ca71f747e2b1&utm_source=crvs2010&utm_medium=lp&utm_campaign=supp_platforms

I hope this helps.