问题描述
我遇到了一个很奇怪的问题,看起来很有趣,好像有些东西跟我很开心.我正在使用 Crystal-Report 版本 13.0.2000.0 和 Visual Studio 2010.几天前我收到了与 Crystal-Report 相关的错误,即:
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 :
无法加载文件或程序集 'file:///C:Program Files (x86)SAP BusinessObjectsCrystal Reports for .NET Framework 4.0CommonSAP BusinessObjects Enterprise XI 4.0win32_x86dotnet1crdb_adoplus.dll' 或其依赖项之一.系统找不到指定的文件.
Could not load file or assembly 'file:///C:Program Files (x86)SAP BusinessObjectsCrystal Reports for .NET Framework 4.0CommonSAP BusinessObjects Enterprise XI 4.0win32_x86dotnet1crdb_adoplus.dll' or one of its dependencies. The system cannot find the file specified.
谷歌搜索后,我发现 解决方案, 然后我在 app.config 文件中添加了以下代码,它运行良好,我没有错误,没有异常.
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>
今天,当我想在我的另一个项目中使用相同的解决方案时,它显示了我应该下载 .NetFrwamework 4.0 的消息,它会导致项目无法运行.我以为我在配置中遗漏了一些东西,所以我去看看我在之前的项目中做了什么配置.有趣的一点是,当我打开项目时,它向我显示了下载 .NetFramework 4.0 的相同消息,而它在几天前运行良好,我对此没有任何问题.但现在 .... .
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.
推荐答案
花了好几个小时解决了我的问题,不知道怎么解决的?!!但它不再抛出任何异常.我做过的事情:
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 :
- 我删除了 app.config.
- 我将框架更改为 3.5,然后编译它.
- 删除 AppData/Local/Temp/ 文件夹中所有与项目相关的文件 (Windows 7).
我把它改回4.0(它生成app.config)然后编译它,它自动添加了以下代码:
- I delete app.config.
- I changed framework to 3.5 then compile it.
- Delete all related files with project in AppData/Local/Temp/ folder (Windows 7).
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.
这篇关于CrystalReport 和/或 Visual Studio 2010 的情况非常奇怪,我不知道可能是 .Net Framework的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!