简体   繁体   English

是什么导致我的 ASP.NET MVC 应用程序停止发送电子邮件并回收应用程序池以立即修复它?

[英]What is causing my ASP.NET MVC app to stop emailing and recycling the app pool to immediately fix it?

Every 30 to 60ish minutes, our app's email notifications (via System.Net.Mail.SmtpClient) stop sending.每 30 到 60 分钟,我们应用程序的电子邮件通知(通过 System.Net.Mail.SmtpClient)就会停止发送。 As soon as we recycle the app pool, the emails start flowing again.一旦我们回收应用程序池,电子邮件就会再次开始流动。 I have checked and double-checked the code and added additional USING statements to make certain all SmtpClient-related objects are being properly disposed after use.我已经检查并仔细检查了代码并添加了额外的 USING 语句,以确保所有与 SmtpClient 相关的对象在使用后都被正确处理。 If it were an SMTP issue I don't think recycling the app pool would fix it.如果是 SMTP 问题,我认为回收应用程序池不会解决它。 Has anyone else encountered this issue and figured out the root cause and fix?有没有其他人遇到过这个问题并找出根本原因并修复?

As far as I see from the previous experience with Quartz.NET , the problem is most probably related to IIS rather than the schedulers ie Quartz.NET , Hangfire , etc. You might try to install Keep Alive Service For IIS 6.0/7.5 on the server to which you publish your application.就我以前使用Quartz.NET经验Quartz.NET ,问题很可能与IIS相关,而不是与调度程序(即Quartz.NETHangfire等)有关。您可以尝试在 IIS 6.0/7.5上安装Keep Alive Service For IIS您发布应用程序的服务器。 After that, your published application will be alive after application pool recycling, IIS/Application restarting, etc.之后,您发布的应用程序将在应用程序池回收、IIS/应用程序重新启动等之后处于活动状态。

Note: If you use IIS 7.5 and above you can use the last version of Keep Alive as well.注意:如果您使用IIS 7.5及更高版本,您也可以使用最新版本的Keep Alive Hope this helps...希望这可以帮助...

Possible solution in this SO answer: Email sending service in c# doesn't recover after server timeout此 SO 答案中的可能解决方案: 服务器超时后,c# 中的电子邮件发送服务不会恢复

Bump maxconnections in your web.config凹凸maxconnections在你web.config

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ASP.NET MVC应用程序中的非托管DLL导致App池在IIS服务器上停止 - Unmanaged DLL in ASP.NET MVC app causes App pool to stop on IIS server ASP.NET MVC 5:应用程序池,Windows身份验证和Active Directory - ASP.NET MVC 5: App Pool, Windows Authentication and Active Directory 尝试在ASP.NET MVC应用程序中打开db4o数据库时,是什么导致此DatabaseFileLockedException? - What is causing this DatabaseFileLockedException when trying to open a db4o database in an ASP.NET MVC app? asp.net邮件突然停止工作。 如何调试此问题的asp.net mvc 4应用程序? - asp.net mails suddenly stop working. How I can debug my asp.net mvc 4 app for the issue? 为什么.cshtml更改在应用程序池回收之前不会在本地反映出来? 为什么在Visual Studio中构建项目会停止回收应用程序池? - Why are .cshtml changes are not reflected locally until app pool recycle? Why did building my project in Visual Studio stop recycling the app pool? 我们应该以什么顺序实施Asp.Net Mvc App - In what order should we implement Asp.Net Mvc App NLog 变慢并破坏了我的 ASP.net MVC 应用程序 - NLog slows down and breaks my ASP.net MVC app 无法在我的ASP.NET MVC应用程序中正确配置路由 - Unable to Configure Routes Properly in my ASP.NET MVC app 在我的ASP.NET MVC / AJAX站点上导致这些SQL转换错误的原因是什么? [视频显示问题] - What is causing these SQL casting errors on my ASP.NET MVC/AJAX site? [Video showing problem] 如果没有应用程序回收,在 ASP.NET 中使用后台工作人员是否有好处? - Are the benefits to using background workers in ASP.NET if there isn't app recycling?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM