一个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.

windos 为什么会突然服务停止了_Windows服务异常自动关闭相关推荐

  1. windos 为什么会突然服务停止了_Win7系统print spooler服务老是自动停止怎么办

    如今打印机算是非常普遍的外围设备,现在很多家庭用户基本上都安装龙打印机.不过昨日有位Win7系统的网友家里就出现了一个关于打印机的故障.那是打印机print spooler服务总是自动停止,导致打印机 ...

  2. Redis服务停止报错解决方案[NOAUTH Authentication required]

    Redis服务停止报错解决方案[NOAUTH Authentication required] 参考文章: (1)Redis服务停止报错解决方案[NOAUTH Authentication requi ...

  3. 记-更改配置而不需停止并重新启动服务

    有时,我希望做到,当修改了某些配置后,不停止服务并重启服务就让配置生效,按照下述即可: ps ax |grep xxx 查找到该服务的进程id(pid) kill -HUP pid 这样就能实现不停止 ...

  4. 停止了IIS服务为什么apache还是启动不了呢?

    当你在计算机服务里找到iis服务停止了 但是还是启动不了 apache 服务,让人头痛其实解决这个办法不难.请你再停止多一个服务就可以了 右键我的电脑--管理--服务--找到"World W ...

  5. linux 重启命令_如何在 Ubuntu 和其他 Linux 发行版中启动、停止和重启服务 | Linux 中国...

    服务是必不可少的后台进程,它通常随系统启动,并在关机时关闭.-- Sergiu 服务是必不可少的后台进程,它通常随系统启动,并在关机时关闭.如果你是系统管理员,那么你会定期处理服务.如果你是普通桌面用 ...

  6. macOS如何使用命令启动服务/停止服务/查看服务

    文章目录 开启服务 停止服务 查看服务是否启动 开启服务 使用命令开启 sshd 服务: $ sudo launchctl load -w /System/Library/LaunchDaemons/ ...

  7. python 程序停止打印日志_停止 Spring Boot 服务的几种优雅姿势

    在使用 Spring Boot 的时候,都要涉及到服务的停止和启动,当我们停止服务的时候,很多时候大家都是 kill -9 直接把程序进程杀掉,这样程序不会执行优雅的关闭.而且一些没有执行完的程序就会 ...

  8. 本地计算机上的mysql80服务启动后停止 某些_MySQL服务启动:某些服务在未由其他服务或程序使用时将自动停止...

    这几天因为工作需求,需要把MySQL请出来,所以将尘封已久的MySQL进行启动.可是事与愿违,兴许是许久没有访问MySQL了,MySQL生气的不理我,并向外抛出一阵阵报错. 1.其中一个是:Windo ...

  9. DaDa英语宣布12月31日起全面停止所有外教服务

    12月7日消息,DaDa英语在其微信公众号发布停服公告,将于2021年12月31日24:00全面停止所有外教服务. 公告称,目前公司已组建专项退费小组,12月7日起将按照学员退费确认时间分批办理退费, ...

最新文章

  1. 最快捷的PPT技能提升之路 PPT定制 驼峰设计
  2. Android开发3g、wap、net的区别
  3. VTK与Qt整合的示例
  4. python3 32位_Python3.8.2安装教程
  5. python天天向上每十天休息一天_Python基础第十天
  6. 数据结构与算法专题——第九题 鸡尾酒排序
  7. Halcon算子学习:图像阈值分割-threshold、binary_threshold、dyn_threshold算子
  8. 【Antlr】cannot create implicit token for string literal in non-combined grammar xx
  9. struts html:select 默认选中,Struts2自动选择下拉框的值
  10. 各种边缘检测算子特点比较(canny)
  11. BZOJ5219[Lydsy2017省队十连测] 最长路径
  12. Java语言实现自动关机程序
  13. 基于ESXi虚拟服务器搭建
  14. pdf密码忘了怎么解除
  15. 漫画:程序员找工作—外包公司
  16. 4.1 js小练习题javascript 今日小练习
  17. 【考研英语语法】定语从句全面介绍
  18. C#到底是面向对象还是面向过程
  19. 如何安装ruby、rails
  20. 怎么查看各进程分别占用多少服务器内存?

热门文章

  1. Buuctf(misc) 后门查杀
  2. 解决php文件包含的问题;Web_php_include-攻防世界
  3. Python基础教程:return函数的用法
  4. python中判断实例可迭代地几种方式
  5. Python教程:多维列表(元组)碾成一维形式
  6. Python使用正则表达式分割字符串
  7. python列表中enumerate和zip函数用法
  8. Python基础教程:类的property特性
  9. Python面向对象之定制对象独有特征
  10. 自动驾驶小车循迹 图像二值化方法