There are many new features in .NET Framework. So in this
.NET interview questions
section quickly go through new exciting feature of .NET 4.5 framework.
1) Set Default culture to App Domain
In the previous versions of .NET if I need to set culture I need to do it on every thread. Below is a sample code which demonstrates the pain of setting culture at thread levels.That was a real pain when we have heavy multi-threaded application.
CultureInfo cul = new CultureInfo(strCulture);
Thread.CurrentThread.CurrentCulture = cul;
Thread.CurrentThread.CurrentUICulture = cul;
In 4.5 we can set culture at the app domain level and all the threads inside that appdomain will inherit that culture. Below is a sample code of how to implement “DefaultThreadCurrentCulture”.
CultureInfo culture =
CultureInfo.DefaultThreadCurrentCulture = culture;
2) Array support more than 2 Gigabyte size
I am not sure what kind of scenario we need a 2 Giga collection. So I personally did not see where we need this feature. If I ever need such a big collection I would break it in to parts. But I am sure there should be a good reason for this feature to be enabled in the framework.
3) Unicode support for console
I left this feature out from discussion as very less people work with console application. I have seen people using console only for academic purpose. Said and done we now have Unicode support for console apps also.