SMTPClient.Send崩溃生产应用程序 [英] SMTPClient.Send crashes production application

查看:182
本文介绍了SMTPClient.Send崩溃生产应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我开发的几乎所有应用程序中,我都使用了System.Net.Mail.SMTPClient类。我从来没有遇到任何问题。然而,我遇到一个非常烦人的情况,调用SMTPClient.Send会导致我的生产应用程序在一个TRY / CATCH块中崩溃,并且EXE被删除!



WTF。在开发环境中,没有任何问题,电子邮件没有问题。



应用程序是用C#编写的,在Visual Studio 2010中创建。我有一个安装项目它创建该应用程序安装的setup.exe文件。每当生产应用程序调用STMPClient.Send时,它会崩溃而不会出现警告,EXE消失。



我已经验证了所有的smtp设置,正如我所说,没有问题有人在开发环境中运行。



有没有人知道可能会导致这种奇怪的行为?

解决方案

已经通过评论解决了,但为未来引用添加了一个答案



检查您的防病毒设置,不喜欢它,删除可执行文件没有任何警告。如果您要在客户端的计算机上部署,请确保您购买软件发行商的数字证书。但是,如果您的应用程序已被列入黑名单,则可能需要采取进一步措施,例如向相关实体提交白名单请求。


I have used the System.Net.Mail.SMTPClient class in virtually every application I have developed. I have never had any issues with it. However, I am encountering an extremely annoying situation in which a call to SMTPClient.Send causes my production application to crash EVEN WITHIN A TRY/CATCH BLOCK, and THE EXE IS DELETED!

WTF. In the development environment there is no problem whatsoever, email is sent without a hitch.

The application is written in C# and created in Visual Studio 2010. I have a setup project which creates the setup.exe file that the app is installed with. Every time that the production app calls STMPClient.Send it crashes without warning and the EXE disappears.

I have verified all smtp settings and, as I said, there is no problem when running in the development environment.

Does anyone have any idea what could be causing this strange behavior?

解决方案

This has been resolved already through a comment, but adding an answer for future references

Check your anti-virus settings, it might not like it and remove the executable without any warnings. If you are deploying this on client's computers, make sure you purchase a Software Publisher's Digital Certificate. But if your app has been "blacklisted" you might need to take further steps, like submitting a whitelist request to the pertinent entity.

这篇关于SMTPClient.Send崩溃生产应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆