0

我创建了一个 Windows 服务,基本上它只是创建一个报告,然后将其导出为 pdf 和电子邮件。

我在调试模式下运行了整个应用程序,它工作得非常好。

现在我为安装它的windows服务创建了一个安装程序,它是成功的,但是windows服务在这一点上卡住了..

string reportPath = Application.StartupPath;
EventLog.WriteEntry("REPORT PATH" + reportPath);
reportPath = reportPath + "\\Reports\\";
EventLog.WriteEntry("NEW REPORT PATH" + reportPath);  //THIS IS THE LAST OUTPUT ...
             try
                {


                         reportViewer1.Reset();
                         reportViewer1.ProcessingMode = ProcessingMode.Local;

                         EventLog.WriteEntry("GREPORTID= " + gReportID); // THIS POINT IS NEVER REACHED IN EVENT VIEWER....

所以我无法找出代码有什么问题?因为它在调试模式下工作得很好。现在它不会超过这一点,服务也陷入启动模式。我也安装后自动运行它。

更新

确切地说,这是它不会通过的线:

  reportViewer1.Reset();

另外我以管理员身份运行设置,所以不确定我怎么能缺少权限?

任何帮助都非常感谢。

4

1 回答 1

0

我刚刚补充说:

reportViewer1=new reportViewer1();

并且在旅途中而不是添加设计师并且它工作。

于 2013-06-17T14:09:41.933 回答