BONUS TIP! More on Obsolte APIs

Posted Monday, April 25, 2005 1:38 PM by C-Dog's .NET Tip of the Day
I was converting some ASP.NET code from 1.1 to 2.0 last night and I ran into some of the items that are now considered obsolete.  Since none of you I am sure have bothered to read that document, I'll point out what I found.
The ConfigurationSettings class has been marked as obsolete.  You most likely have used this for it's AppSettings collection.  It has been replaced with the ConfigurationManager class.  You can use the AppSettings collection just like you had before.  One thing to note is that it also provided a ConnectionStrings collection for use with the new ConnectionStrings section of the web.config.  It also provided the GetSection which allow you to get an entire configuration section (if you create your own for example).
The System.Web.Mail.SmtpMail class has also been marked obsolete.  This has been replaced with the System.Net.Mail.SmtpClient class.  The syntax appears to be the same as the old mail object.   However this new object also supports a SendAsync method which will let you send the message without blocking the thread.  It also supports a bunch of new properties such as credentials, ports, ssl support, and timeouts.
Note, that you can still use the Obsolete API calls and your application will still work.  However, the compiler will display a warning every time you compile letting you know things are obsolete.

Read the complete post at