windos 为什么会突然服务停止了_Windows服务异常自动关闭
一個Windows服務程序,在其他服務器運行都是正常的,今天在新服務器中運行,出現未知異常。
1.查看系統日志:自定義視圖--管理日志
2.日志內容,比如
-
-
1026
2
0
0x80000000000000
499672
Application
WIN-N6Q3A4U468A
-
Application: LgWinService.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.AccessViolationException Stack: at SNINativeMethodWrapper.SNIClose(IntPtr) at System.Data.SqlClient.SNIHandle.ReleaseHandle() at System.Runtime.InteropServices.SafeHandle.InternalDispose() at System.Runtime.InteropServices.SafeHandle.Dispose(Boolean) at System.Runtime.InteropServices.SafeHandle.Dispose() at System.Data.SqlClient.TdsParserStateObject.Dispose() at System.Data.SqlClient.TdsParser.Disconnect() at System.Data.SqlClient.SqlInternalConnectionTds.LoginFailure() at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(System.Data.ProviderBase.TimeoutTimer, System.Data.SqlClient.SqlConnectionString, System.Data.SqlClient.SqlCredential, System.String, System.Security.SecureString, Boolean) at System.Data.SqlClient.SqlInternalConnectionTds..ctor(System.Data.ProviderBase.DbConnectionPoolIdentity, System.Data.SqlClient.SqlConnectionString, System.Data.SqlClient.SqlCredential, System.Object, System.String, System.Security.SecureString, Boolean, System.Data.SqlClient.SqlConnectionString, System.Data.SqlClient.SessionData) at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(System.Data.Common.DbConnectionOptions, System.Data.Common.DbConnectionPoolKey, System.Object, System.Data.ProviderBase.DbConnectionPool, System.Data.Common.DbConnection, System.Data.Common.DbConnectionOptions) at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(System.Data.ProviderBase.DbConnectionPool, System.Data.Common.DbConnection, System.Data.Common.DbConnectionOptions, System.Data.Common.DbConnectionPoolKey, System.Data.Common.DbConnectionOptions) at System.Data.ProviderBase.DbConnectionPool.CreateObject(System.Data.Common.DbConnection, System.Data.Common.DbConnectionOptions, System.Data.ProviderBase.DbConnectionInternal) at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(System.Data.Common.DbConnection, System.Data.Common.DbConnectionOptions, System.Data.ProviderBase.DbConnectionInternal) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(System.Data.Common.DbConnection, UInt32, Boolean, Boolean, System.Data.Common.DbConnectionOptions, System.Data.ProviderBase.DbConnectionInternal ByRef) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(System.Data.Common.DbConnection, System.Threading.Tasks.TaskCompletionSource`1, System.Data.Common.DbConnectionOptions, System.Data.ProviderBase.DbConnectionInternal ByRef) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(System.Data.Common.DbConnection, System.Threading.Tasks.TaskCompletionSource`1, System.Data.Common.DbConnectionOptions, System.Data.ProviderBase.DbConnectionInternal, System.Data.ProviderBase.DbConnectionInternal ByRef) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(System.Data.Common.DbConnection, System.Data.ProviderBase.DbConnectionFactory, System.Threading.Tasks.TaskCompletionSource`1, System.Data.Common.DbConnectionOptions) at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(System.Data.Common.DbConnection, System.Data.ProviderBase.DbConnectionFactory, System.Threading.Tasks.TaskCompletionSource`1, System.Data.Common.DbConnectionOptions) at System.Data.SqlClient.SqlConnection.TryOpenInner(System.Threading.Tasks.TaskCompletionSource`1) at System.Data.SqlClient.SqlConnection.TryOpen(System.Threading.Tasks.TaskCompletionSource`1) at System.Data.SqlClient.SqlConnection.Open() at Dos.ORM.Database.CreateConnection(Boolean) at Dos.ORM.Database.ExecuteReader(System.Data.Common.DbCommand) at Dos.ORM.Section.ToDataReader() at Dos.ORM.Section.ToList[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]() at DAL.DBModelDAL.Base_SchoolDAL.GetAllFromBaseView() at BLL.DBModelBLL.Base_DataBLL.InitResSubjectFirst() at LgBigData.WinService.QuartzJob.BaseDataJob.Execute(Quartz.IJobExecutionContext) at Quartz.Core.JobRunShell.Run() at Quartz.Simpl.SimpleThreadPool+WorkerThread.Run() at System.Threading.ThreadHelper.ThreadStart_Context(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.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) at System.Threading.ThreadHelper.ThreadStart()
3.確定問題:?System.Data.SqlClient?的問題。
微軟官方回答:
https://support.microsoft.com/zh-cn/help/2915689/applications-crash-and-accessviolationexception-exception-occurs-when
?https://support.microsoft.com/en-us/help/2915689/applications-crash-and-accessviolationexception-exception-occurs-when
4.解決方法
卸載.NET 4.5.1或者升級.NET
不推薦使用.NET 4.5.1
Resolution
To resolve this issue, upgrade the .NET Framework 4.5.1 to?the Microsoft .NET Framework 4.5.2.
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的windos 为什么会突然服务停止了_Windows服务异常自动关闭的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 1660s功耗多少w_1660显卡要多大
- 下一篇: aiohttp 高并发web服务_【Py