C# Crystal Reports运行时的不同版本

C# Crystal Reports运行时的不同版本,c#,.net,winforms,crystal-reports,C#,.net,Winforms,Crystal Reports,我有两个WinForm应用程序,它们使用CR运行时生成报告。当安装CR运行时13.20时,较新的应用程序会抱怨无法找到并加载CR 13.21(13.0.350)程序集。如果我将CR运行时升级到13.21(13.0.350),那么新的应用程序将正常工作,但旧的应用程序会出错,异常情况是它无法找到并加载CR运行时程序集13.20(13.0.200)。 所有工作站都在CR运行时13.20上运行,那么我如何才能使在VS2015中创建的新应用程序在CR 13.21环境下在旧CR运行时上正确运行?首先,从旧

我有两个WinForm应用程序,它们使用CR运行时生成报告。当安装CR运行时13.20时,较新的应用程序会抱怨无法找到并加载CR 13.21(13.0.350)程序集。如果我将CR运行时升级到13.21(13.0.350),那么新的应用程序将正常工作,但旧的应用程序会出错,异常情况是它无法找到并加载CR运行时程序集13.20(13.0.200)。
所有工作站都在CR运行时13.20上运行,那么我如何才能使在VS2015中创建的新应用程序在CR 13.21环境下在旧CR运行时上正确运行?

首先,从旧应用程序中删除CR运行时引用,并添加对CR 13.21的引用。它将正常工作。

我也有同样的问题。客户机上的应用程序使用13.0.20,而我的应用程序使用13.0.21。我有13.0.21的参考集。但我们遇到的问题是SAP安装程序fro 13.0.21迫使我们从客户端工作站删除13.0.20。因此,所有其他应用程序抛出程序集未找到错误


有办法同时安装20和21吗?

您需要升级您的引擎以匹配您的最新版本。以我为例。我的引擎运行在13.2上,我得到的最新.dll文件是13.5,因此使用Nuget控制台,您可以直接从visual studio升级引擎(示例安装包CrystalReports.engine-Version 13.0.3500)

您可以告诉您的“旧crystal runtime app”使用新的crystal reports runtime。您只需在app.config文件中创建AssemblyBinding:

    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="CrystalDecisions.Shared" publicKeyToken="692fbea5521e1304" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-13.0.3500.0" newVersion="13.0.3500.0" />
          </dependentAssembly>
          [...]
    </assemblyBinding>

[...]

您可以使用配置文件将旧应用程序重定向到新的运行时。 使用记事本在旧应用程序(使用旧Crystal runtime的应用程序)所在的文件夹中创建文件名您的旧应用程序\u exe\u name.exe.config


检查两个项目中对CrystalObjects的引用的版本。我怀疑每个项目都引用了不同的版本。如果是这种情况,那么更新两个项目中的引用以使用相同的版本应该可以解决问题。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="CrystalDecisions.CrystalReports.Engine" publicKeyToken="692fbea5521e1304" culture="neutral"/>
      <bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="CrystalDecisions.ReportSource" publicKeyToken="692fbea5521e1304" culture="neutral"/>
      <bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
    </dependentAssembly>    
    <dependentAssembly>
      <assemblyIdentity name="CrystalDecisions.Shared" publicKeyToken="692fbea5521e1304" culture="neutral"/>
      <bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="CrystalDecisions.Web" publicKeyToken="692fbea5521e1304" culture="neutral"/>
      <bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="CrystalDecisions.Windows.Forms" publicKeyToken="692fbea5521e1304" culture="neutral"/>
      <bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="CrystalDecisions.ReportAppServer.ClientDoc" publicKeyToken="692fbea5521e1304" culture="neutral"/>
      <bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="CrystalDecisions.ReportAppServer.CommonControls" publicKeyToken="692fbea5521e1304" culture="neutral"/>
      <bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="CrystalDecisions.ReportAppServer.CommonObjectModel" publicKeyToken="692fbea5521e1304" culture="neutral"/>
      <bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="CrystalDecisions.ReportAppServer.Controllers" publicKeyToken="692fbea5521e1304" culture="neutral"/>
      <bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="CrystalDecisions.ReportAppServer.CubeDefModel" publicKeyToken="692fbea5521e1304" culture="neutral"/>
      <bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="CrystalDecisions.ReportAppServer.DataDefModel" publicKeyToken="692fbea5521e1304" culture="neutral"/>
      <bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="CrystalDecisions.ReportAppServer.DataSetConversion" publicKeyToken="692fbea5521e1304" culture="neutral"/>
      <bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
    </dependentAssembly>    
    <dependentAssembly>
      <assemblyIdentity name="CrystalDecisions.ReportAppServer.ObjectFactory" publicKeyToken="692fbea5521e1304" culture="neutral"/>
      <bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="CrystalDecisions.ReportAppServer.Prompting" publicKeyToken="692fbea5521e1304" culture="neutral"/>
      <bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="CrystalDecisions.ReportAppServer.ReportDefModel" publicKeyToken="692fbea5521e1304" culture="neutral"/>
      <bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="CrystalDecisions.ReportAppServer.XmlSerialize" publicKeyToken="692fbea5521e1304" culture="neutral"/>
      <bindingRedirect oldVersion="13.0.2000.0" newVersion="13.0.3500.0"/>
    </dependentAssembly>
  </assemblyBinding>  
</runtime>
</configuration>