Very Odd situation with CrystalReport and/or Visual studio 2010 I don't know maybe .Net Framework

你离开我真会死。 提交于 2019-12-21 05:05:07

问题


I faced a very odd problem It seems very funny looks like some stuffs having a fun with me. I'm using Crystal-Report Version 13.0.2000.0 and Visual Studio 2010. Number of days ago I got a error related with my Crystal-Report, that was :

Could not load file or assembly 'file:///C:\Program Files (x86)\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 googling I found solution, Then I added the following code to app.config file and It worked well, I had no error, no exception.

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

Today when I wanted to use same solution in my other project it showed the message that I should download .NetFrwamework 4.0 and It causes project to not run. I thought I missed something in configuration so I went to look exactly what configurations I did in previous project. Interesting point is here when I opened the project it shows me same message to download .NetFramework 4.0, while It worked very well number of days ago and I don't have any problem with that. But now .... .

I don't know what is the problem. Any advice will be helpful.


回答1:


After spent many hours, I solved my problem, I don't have any idea how ?!! but It doesn't throw any exception anymore. Things I've done :

  1. I delete app.config.
  2. I changed framework to 3.5 then compile it.
  3. Delete all related files with project in AppData/Local/Temp/ folder (Windows 7).
  4. I changed it back to 4.0 (It generated app.config) then compile it, It automatically added following code:

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

I ran my application without any error and exception. I don't know what was the problem but by doing these steps I fixed my issues.




回答2:


Just one thing, maybe useful for someone: for use Crystal Reports in VS 2010, you have to use Framewok 4.0 (not Framewok 4.0 Client Profile)




回答3:


You can create a folder called "dotnet1" in C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86 and copy the dll crdb_adoplus.dll in it. this solution worked for me.



来源:https://stackoverflow.com/questions/7619745/very-odd-situation-with-crystalreport-and-or-visual-studio-2010-i-dont-know-may

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!