Error in Crystal Report: could not load file or assembly file' '
Asked Answered
R

4

6

in my project i use visual studio 2010,crystal report 2010 & Crystal.Reports.2010.Support.Pack.v13.0.5. when i run code's and call crystal report viewer. this error Occurred in my windows application. how can i solved this error in c# win App ?

Error :

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.

Rhizo answered 7/6, 2014 at 7:14 Comment(0)
R
19

I think you require this code, add it into your web.config

<startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>

Pretty sure this is on google, it maybe a duplicate (will search after answering)

EDIT:

You may have to edit your .Net setting within your build configuration. Maybe try uninstalling the crystal assemblies - set .Net 4 and reinstall (assuming you weren't already on .Net 4) – n34_panda yesterday

Rightly answered 7/6, 2014 at 7:19 Comment(4)
it's for web application and work in asp.net web.config.Rhizo
Add it into your .config: erickwidya.blogspot.co.uk/2011_05_01_archive.htmlRightly
windows application do'es not contain .config file. other solutionRhizo
You may have to edit your .Net setting within your build configuration. Maybe try uninstalling the crystal assemblies - set .Net 4 and reinstall (assuming you weren't already on .Net 4)Rightly
D
7

It's working for me.

I added the App.config file to my application (window) and then added the below tag inside the configuration tag.

<startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
Diadiabase answered 2/7, 2014 at 12:0 Comment(0)
S
4

Please go to your app.config and check if useLegacyV2RuntimeActivationPolicy is there or not either add this as follow.

<startup useLegacyV2RuntimeActivationPolicy="true"> 
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />

</startup>

For more detail i have added the following Screen Shot,Please check it.

enter image description here

Systaltic answered 2/4, 2016 at 3:29 Comment(0)
N
0

Problem Statement:

  • The project was created with an old version of the Crystal Report.
  • The latest / updated / newest version of Crystal Report is installed on the current working computer.
  • The installed version of Crystal Report is not compatible with the old version.
  • Some configurations are needed to be made in the current project to resolve this error

Solution 1:

  • [In Visual Studio] project’s References > Right-click CrystalDecisions.CrystalReports.Engine > select Properties. In the properties window, Copy the shown version of the Crystal Report. ** The CR version shown in properties is different than the installed version**
  • Open Web.Config File
  • Replace old CR version 13.0.xx00.0 for all the assemblies in the web config, with the copied version from Reference properties

Solution 2:

  • Open Web.Config File
  • Add tag right before the closing tag. Write old and new version of CR.
<runtime>
  <assemblyBinding xmlns="urn: schemas-   
     Microsoft-com:asm.v1">

    <dependentAssembly>
      <assemblyIdentity name=  
         "CrystalDecisions.CrystalReports.Engine" 
         publicKeyToken=“xxx" culture="neutral"/>

          <bindingRedirect oldVersion="13.0.2000.0" 
            newVersion="13.0.3500.0"/>
    </dependentAssembly>

</assemblyBinding>  
</runtime>

The demo is available here:

Nonfiction answered 7/6, 2023 at 7:10 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.