在远程虚拟机上使用Stimulreport

时间:2014-07-12 13:22:21

标签: c# virtual-machine remote-desktop stimulsoft

我在MS Framework 4.0中有一个C#程序,它使用StimulSoft Report 2010来显示和打印一些报告。
我的程序在我的计算机上工作正常,但是当我尝试在远程虚拟计算机上运行它时,它有问题并给我这个错误:

Application: MyApplication.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.DirectoryNotFoundException
Stack:
at Stimulsoft.Report.StiReport.Load(System.String)
at Tavanmand.StoneCut.ManagementApplication.SlabForm.PrintForm(System.Object, System.Windows.RoutedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs)
at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
at System.Windows.UIElement.ReRaiseEventAs(System.Windows.DependencyObject, System.Windows.RoutedEventArgs, System.Windows.RoutedEvent)
at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
at System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr, System.Windows.Input.InputMode, Int32, System.Windows.Input.RawMouseActions, Int32, Int32, Int32)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr, MS.Internal.Interop.WindowMessage, IntPtr, IntPtr, Boolean ByRef)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at System.Windows.Application.RunInternal(System.Windows.Window)
at System.Windows.Application.Run()
at Tavanmand.StoneCut.ManagementApplication.App.Main()

我对这部分节目有问题。其他部分运作良好。
我在myApplication.exe附近添加了所有的stimulreport dll文件,甚至安装了 StimulSoft Report 2010 ,但它仍然无法正常工作。

我现在该怎么办?

1 个答案:

答案 0 :(得分:1)

堆栈跟踪中的最终调用是在您尝试加载报表文件时。 (捷运)。

这似乎是一个明显的迹象,表明您没有正确设置搜索报告文件的文件夹,从而导致异常

Directory Not Found

对于你的第二条评论,绝对是的。
您需要重新分发项目所需的DLL。如果您查看编程手册,您将找到专门用于重新分配装配的部分。它们会根据您的项目类型而变化。 (第21.12 Redistributable files in Reports.Net条)

可以将Stimulsoft文件简单地复制到安装应用程序的同一文件夹中。当然,您也可以将它们添加到目标计算机的GAC中。但我发现将它们复制到应用程序的同一文件夹中更简单