-1

我正在使用托管构建并且它失败并出现错误,找不到程序集水晶报告。如何使用托管构建代理使用水晶报表?

4

2 回答 2

1

虽然托管代理确实没有安装 Crystal Reports for Visual Studio,但执行编译不需要 COM 组件。您需要构建的只是应用程序引用的 .NET DLL 的副本。

一种解决方法是将您引用的 DLL 添加到存储库并执行条件提示路径以在它们未安装在计算机上的默认位置时使用它们。

<Reference Include="CrystalDecisions.CrystalReports.Engine, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath Condition="!Exists('$(MSBuildProgramFiles32)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet\CrystalDecisions.CrystalReports.Engine.dll')">..\..\lib\CrystalDecisions.CrystalReports.Engine.dll</HintPath>
  <Private>False</Private>
</Reference>
<Reference Include="CrystalDecisions.ReportSource, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath Condition="!Exists('$(MSBuildProgramFiles32)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet\CrystalDecisions.ReportSource.dll')">..\..\lib\CrystalDecisions.ReportSource.dll</HintPath>
  <Private>False</Private>
</Reference>
<Reference Include="CrystalDecisions.Shared, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath Condition="!Exists('$(MSBuildProgramFiles32)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet\CrystalDecisions.Shared.dll')">..\..\lib\CrystalDecisions.Shared.dll</HintPath>
  <Private>False</Private>
</Reference>
<Reference Include="CrystalDecisions.Windows.Forms, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath Condition="!Exists('$(MSBuildProgramFiles32)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\dotnet\CrystalDecisions.Windows.Forms.dll')">..\..\lib\CrystalDecisions.Windows.Forms.dll</HintPath>
  <Private>False</Private>
</Reference>

在这里,DLL 被放置在以lib存储库根目录命名的文件夹中。该!Exists条件检查 DLL 是否位于默认位置,如果不是,则切换到使用lib文件夹中的本地位置。

或者,您可以将它们托管在私有 NuGet 提要或 MyGet 提要上,而不是将二进制文件签入您的存储库。请注意,在 NuGet 上也有这些库的非官方副本,您也可以参考,但通常不清楚包作者提交的二进制文件的版本。

于 2019-01-26T01:55:57.863 回答
0

托管代理无法构建 Crystal 报表,因为托管代理未安装适用于 Visual Studio 的 Crystal Reports。

您应该通过为 Visual Studio 安装 Crystal 报表的私人代理来构建 Crystal 报表。

于 2017-11-24T08:34:50.250 回答