【发布时间】:2015-11-09 22:04:43
【问题描述】:
我正在尝试使用 WIX 部署一个 winforms 应用程序来创建 .exe。 我能够创建 .exe 并安装我的应用程序。 但我无法打印报告 - 没有报告预览,应用程序只打印我的报告。当我尝试时,我得到了错误:
Object reference not set to an instance of an object
在下面一行:
LocalReport localReport = new LocalReport();
当我在 VS2013 上运行我的应用程序时,它运行良好,但部署的应用程序无法运行(同一台机器)。
我有一个 Bundle.wxs:
<PackageGroup Id="ReportViewer">
<MsiPackage Id="ReportViewer"
SourceFile="Files\ReportViewer.msi"
Cache="no"
Compressed="yes"
Permanent="yes"
Vital="yes"
InstallCondition="VersionNT >= v5.1 AND NOT ReportViewer10Install = 1"/>
</PackageGroup>
还有一个 Product.wxs
<Component Guid="xxx">
<File Source="$(var.Forms.TargetDir)\Microsoft.ReportViewer.Common.dll" KeyPath="yes" />
</Component>
<Component Guid="xxx">
<File Source="$(var.Forms.TargetDir)\Microsoft.ReportViewer.WinForms.dll" KeyPath="yes" />
</Component>
<Component Guid="xxx">
<File Source="$(var.Forms.TargetDir)\Reports\MyReport.rdlc" KeyPath="yes" />
</Component>
Microsoft.ReportViewer.WinForms.dll 和 Microsoft.ReportViewer.Common.dll 对于“复制本地”标记为 true。
谁能帮帮我?
【问题讨论】: