部署后无法在客户端计算机上生成 RDLC 报告
unable to generate RDLC report on client machine after deployment
我创建了一个使用 Microsoft.ReportViewer 来显示 rdlc 报告的应用程序。该应用程序在开发人员上运行良好。机器。现在我正在尝试将它部署到客户端计算机 (windows 7) 上,但是当我生成报告时什么也没有发生。什么都没有。没有错误消息,也没有异常。我猜这是因为缺少 Microsoft.ReportViewer.Winforms.dll/or 框架?我已经为这个 dll 设置了 copyLocal=true 但仍然没有成功。有什么问题?
在将消息框放在不同的地方并捕获异常后,我发现需要在客户端计算机上安装 ReportViewer。这些是显示的错误消息
事实证明,我需要在客户端计算机上安装 ReportViewer.exe,或者需要随安装程序一起运送所需的 dll。所以我添加了对以下 dll 的引用并标记了 CopyLocal=True,这解决了我的问题。
<Reference Include="Microsoft.ReportViewer.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.Common.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.Common.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.ReportViewer.ProcessingObjectModel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.ProcessingObjectModel.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.ProcessingObjectModel.DLL</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.ReportViewer.WinForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<HintPath>C:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WinForms.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.WinForms.DLL</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.SqlServer.Types, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.Types.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Types.dll</HintPath>
<Private>True</Private>
</Reference>
我创建了一个使用 Microsoft.ReportViewer 来显示 rdlc 报告的应用程序。该应用程序在开发人员上运行良好。机器。现在我正在尝试将它部署到客户端计算机 (windows 7) 上,但是当我生成报告时什么也没有发生。什么都没有。没有错误消息,也没有异常。我猜这是因为缺少 Microsoft.ReportViewer.Winforms.dll/or 框架?我已经为这个 dll 设置了 copyLocal=true 但仍然没有成功。有什么问题?
在将消息框放在不同的地方并捕获异常后,我发现需要在客户端计算机上安装 ReportViewer。这些是显示的错误消息
事实证明,我需要在客户端计算机上安装 ReportViewer.exe,或者需要随安装程序一起运送所需的 dll。所以我添加了对以下 dll 的引用并标记了 CopyLocal=True,这解决了我的问题。
<Reference Include="Microsoft.ReportViewer.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.Common.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.Common.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.ReportViewer.ProcessingObjectModel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.ProcessingObjectModel.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.ProcessingObjectModel.DLL</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.ReportViewer.WinForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<HintPath>C:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WinForms.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.WinForms.DLL</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.SqlServer.Types, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.Types.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Types.dll</HintPath>
<Private>True</Private>
</Reference>