.NET 4 Baby Steps: Part XIII - Tiny steps
Note: This post is part of a series and you can find the rest of the parts in the series index.
There are a few tiny additions in .NET 4 that I have not covered yet. This post provides a quick hit list of some of the new and improved features:
New
- [
] StringBuilder.Clear: Quick method to clear a StringBuilder. - [
] Stopwatch.Reset: Quick method to reset a stopwatch timer. - [
] IntPtr & UIntPtr: Both have had two new methods added—one for addition and one for subtraction. - [
] Thread.Yield: Allows yielding execution to another thread that is ready to run on the current processor. - [
] System.Guid: Now includes two new methods—TryParseandTryParseExact—to allow testing of parsing. - [
] Microsoft.Win32.RegistryView: This allows requesting 64-bit or 32-bit views of the registry. - [
] Environment: Now contains two properties to identify 64-bit scenarios: Is64BitOperatingSystem: Identifies whether the OS is 64-bit.Is64BitProcess: Identifies whether the process is 64-bit.
- [
] System.Net.Mail.SmtpClient: Support for SSL.
Improved
- [
] Path.Combine: A new method overload allows combining file paths. - [
] Compression.DeflateStream & Compression.GZipStream: Improved to avoid attempting to compress already compressed data. - [
] Compression.DeflateStream & Compression.GZipStream: The 4 GB size limit has been removed. - [
] Monitor.Enter: A new overload allows passing a reference boolean that returns trueif the monitor was successfully entered. - [
] Microsoft.Win32.RegistryOptions: Now includes an option to specify a volatile key, which is removed when the system restarts. - [
] Registry keys are no longer limited to 255 characters. - [
] System.Net.Mail.MailMessage: Support for new headers: HeadersEncoding: Sets the type of text encoding used in the mail header.ReplyToList: Sets the list of addresses to use when replying to a mail, replacingReplyTo, which only supported one email address.
- [
] System.Net.NetworkCredential: For improved security, passwords can now be stored in a SecureString. - [
] ASP.NET Hashing: The default value has been changed from SHA1 to SHA256. - [
] ASP.NET Output Caching: Previously, setting the output cache to _ServerAndClientalso required calling_SetOmitVaryStarto ensure it would be cached on the client. From .NET 4,_SetOmitVaryStaris no longer needed. - [
] TimeZoneInfo.Local & DateTime.Now: Both now follow OS daylight saving settings rather than using .NET Framework settings. - [
] When running on Windows 7, locale info is retrieved from the OS instead of being stored in the framework. - [
] Support for all 14,000 characters of Unicode 5.1. - [
] ServiceInstaller.DelayedAutoStart: On modern OSes (Vista, Win 7, etc.), services can start as Automatic (Delayed). This means they start after system boot, allowing users to log in quickly. This is now possible for .NET apps using the DelayedAutoStartproperty.