Friday, March 24, 2006

Useful Links on Localization

I 'm working on a localization project now. I found that the follwing links are helpful:

Monday, March 20, 2006

Resource Fallback Process

The hub and spoke model for packaging and deploying resources uses a fallback process to locate appropriate resources. If an application user requests a ResourceSet that is unavailable, the common language runtime searches the hierarchy of cultures looking for an appropriate fallback resource that most closely matches the user's request, and raises an exception only as a last resort. At each level of the hierarchy, if an appropriate resource is found, the runtime uses it. If the resource is not found, the search continues at the next level. The resource fallback process is described in the following steps:

  • The runtime first checks the GAC for an assembly matching the requested culture for your application.
  • The runtime next checks the directory of the currently executing assembly for a directory matching the requested culture. If it finds the directory, it searches that directory for a valid satellite assembly for the requested culture.
  • The runtime next searches the global assembly cache again, this time for the parent assembly of the requested resource. The parent is defined as the appropriate fallback culture. Consider parents as best-fit candidates; providing any resource is preferable to throwing an exception.
  • The runtime next checks the directory of the currently executing assembly to see if it contains a parent directory. If a parent directory exists, the runtime searches the directory for a valid satellite assembly for the parent culture.
  • The runtime next searches parent assemblies, as in the previous step, through many potential levels. Each culture has only one parent, but a parent might have its own parent.
  • If the culture that was originally specified and all parents have been searched and the resource is still not found, the resource for the default (fallback) culture is used.
  • Finally, if the runtime does not find a resource for a default (fallback) culture, an exception is thrown indicating that the resource could not be found.

Adopted from SDK.

Thursday, March 16, 2006

How to Enable CLR in SQL Server 2005

CLR is disable by default in SQL Server 2005. So if you write a SQL assembly and deploy it to your SQL Server 2005. It won't let you execute it.

The SQL Server 2005 Surface Area Configuration let you enable CLR - without having to do it the t-sql way. The tool is under start/All programs/sql server 2005/Configuration Tools. Once in there, you can choose between "Surface Area Config for Services & Connections" or "surface Area Config for Features". Choose Features and you will see the CLR checkbox.

I learned this from Julie Lerman.

Thursday, March 02, 2006

List of .NET 2.0 and C# 2.0 new features

In his article List of .NET 2.0 and C# 2.0 new features, Patrick Smacchia gave short descriptions on .NET 2.0 and C# 2.0 new features. Here is an example (quoted from his article).

The use of the AssemblyKeyFile attribute to sign an assembly is to be avoided. It is now preferred that you use the /keycontainer and /keyfile options of csc.exe, or the new project properties of Visual Studio 2005.

I'll use his list to check if I do something that are not favorable to .NET 2.0 and C# 2.0.

How to Create a Debugger Visualizer

In his article Create a Debugger Visualizer in 10 Lines of Code, Tomer Noy shows how to create a debugger visualizer to view Image objects. Very cool.