Categories: Blog

Devscovery 2009 Redmond follow-up

During my CLR/BCL/C# 4.0 talk, a few people asked me questions for which I didn’t have the answer. I have now researched these questions and have the answers.

 

Question #1: Are the new concurrent collection classes in .NET 4.0 serializable?

Answer: Yes, ConcurrentStack, ConcurrentQueue, ConcurrentBag, and ConcurrentDictionary are all serializable. However, the BlockingCollection class (which can wrap any of these except for ConcurrentDictionary) is not serializable.

 

Question #2: How do you set multiple fallback languages with the ResourceManager class in Silverlight and in .NET 4.0?

Answer: The ResourceManager calculates the full fallback sequence as follows:

   1. Requested culture (argument to GetString or GetObject), if provided, or current thread UICulture (let’s call this C1) – as of .NET 4.0, only one culture can be specified this way.

   2. C1’s parent; repeat up parent chain but stop before invariant culture

   3. Cultures returned by the Win32 GetThreadPreferredUILanguages (passing the MUI_MERGE_USER_FALLBACK | MUI_MERGE_SYSTEM_FALLBACK flags), removing duplicates from 1 & 2 – this is the new addition in Silverlight & .NET 4.

   4. Invariant culture

Jeffrey Richter

Recent Posts

8-Step AWS to Microsoft Azure Migration Strategy

Microsoft Azure and Amazon Web Services (AWS) are two of the most popular cloud platforms.…

2 weeks ago

How to Navigate Azure Governance

 Cloud management is difficult to do manually, especially if you work with multiple cloud…

3 weeks ago

Why Azure’s Scalability is Your Key to Business Growth & Efficiency

Azure’s scalable infrastructure is often cited as one of the primary reasons why it's the…

1 month ago

Unlocking the Power of AI in your Software Development Life Cycle (SDLC)

https://www.youtube.com/watch?v=wDzCN0d8SeA Watch our "Unlocking the Power of AI in your Software Development Life Cycle (SDLC)"…

2 months ago

The Role of FinOps in Accelerating Business Innovation

FinOps is a strategic approach to managing cloud costs. It combines financial management best practices…

2 months ago

Azure Kubernetes Security Best Practices

Using Kubernetes with Azure combines the power of Kubernetes container orchestration and the cloud capabilities…

2 months ago