WPF项目中使用水晶报表for vs2010时的一个找不到程序集的问题
问题描述:
未能加载文件或程序集“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”或它的某一个依赖项。系统找不到指定的文件。
解决方法:
在项目配置文件app.config添加如下节点
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
完整配置如下:
<?xml version="1.0"?>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="wpfCRTest.Properties.Settings.TestConnectionString"
connectionString="Data Source=xx;Initial Catalog=Test;
Persist Security Info=True;User ID=sa;Password=sa"
providerName="System.Data.SqlClient" />
</connectionStrings>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
<configuration>
<configSections>
</configSections>
<connectionStrings>
<add name="wpfCRTest.Properties.Settings.TestConnectionString"
connectionString="Data Source=xx;Initial Catalog=Test;
Persist Security Info=True;User ID=sa;Password=sa"
providerName="System.Data.SqlClient" />
</connectionStrings>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>