Breaking changes in .NET 4.0

后端 未结 5 1471
南笙
南笙 2020-11-27 12:23

There is a lot of information about new features and classes in new 4.0 however there are also changes that may affect existing applications, for example

  1. Ti

5条回答
  •  自闭症患者
    2020-11-27 13:03

    Also note that SmtpClient now implements IDisposable so you should now use something like this:

    using (var smtpclient = new SmtpClient())
    {
      smtpclient.Send(message);
    } 
    

    According to this page there might be more of these 'hidden jams' inside the .NET 4.0 framework. And the author suggest to find them by using FxCop on your code.

提交回复
热议问题