当我将我的应用程序作为服务

时间:2016-03-31 05:03:43

标签: c# .net opencv windows-services .net-4.5

实际上我正在开发OpenCV。我创建了两个应用程序,一个是Windows窗体应用程序,另一个是窗口服务,应用程序包含相同的代码。 当我将其作为Windows应用程序运行时,一切正常。当我试图将它作为Windows服务运行时,它会抛出异常。

我曾搜索过这个例外,他们说它会发生bcz缺乏内存管理。我可以克服这个异常。

 Application: DSG Service.exe
 Framework Version: v4.0.30319
 Description: The process was terminated due to an unhandled exception.
 Exception Info: System.AccessViolationException
 at Emgu.CV.CvInvoke.CvCascadeClassifierDetectMultiScale(IntPtr, IntPtr,IntPtr, Double, Int32, Int32, System.Drawing.Size, System.Drawing.Size)
 at       Emgu.CV.CascadeClassifier.DetectMultiScale(Emgu.CV.Image`2<Emgu.CV.Structure.Gra  y,Byte>, Double, Int32, System.Drawing.Size, System.Drawing.Size)
 at DSG.Service.ReadMyFace.Timer_Frame_Grabber_Tick(System.Object,System.Timers.ElapsedEventArgs)
 at System.Timers.Timer.MyTimerCallback(System.Object)
 at System.Threading.TimerQueueTimer.CallCallbackInContext(System.Object)
 at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
 at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
 at System.Threading.TimerQueueTimer.CallCallback()
 at System.Threading.TimerQueueTimer.Fire()
 at System.Threading.TimerQueue.FireNextTimers()
 at System.Threading.TimerQueue.AppDomainTimerCallback()

Faulting application name: DSG Service.exe, version: 1.0.0.0, time stamp: 0x56fca95e
Faulting module name: opencv_objdetect2410.dll, version: 0.0.0.0, time stamp: 0x547df585
Exception code: 0xc0000005
Fault offset: 0x00028768
Faulting process id: 0xd40
Faulting application start time: 0x01d18b06f8432dbd
Faulting application path:      E:\Amit\Projects\DSG\DotNetClient\DSG.Application\DSG Service.exe
Faulting module path:   E:\Amit\Projects\DSG\DotNetClient\DSG.Application\x86\opencv_objdetect2410.dll
Report Id: 388a222d-f6fa-11e5-96cb-fcaa14a29764

0 个答案:

没有答案