Search code examples
c#.netvisual-studio-2012visual-studio-2008crystal-reports

file not found exception was unhandled on crystal report migrating from vs2008 to vs2012 in c#


I am trying to open VS2008 version application in VS2012, while running the application where it has to generate crytal report it gives an 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.

I can see the crystal report its fine. I already made changes in appconfig file :

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

So please advice. Thanks


Solution

  • Modify all of your app.config.(if more than one)

    Before

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

    After

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