Satellite Assemblies

While looking for the use of satellite assemblies, I came across many examples. But, when I tried to run them, most of them did not fulfill my expectations from a satellite assembly.

In this article, you'll see what satellite assemblies are, how to create them, and how to use satellite assemblies with strong named assemblies with very simple and small pieces of code chunks.

What Is a Satellite Assembly?

A definition from MSDN says something like this: "A .NET Framework assembly containing resources specific to a given language. Using satellite assemblies, you can place the resources for different languages in different assemblies, and the correct assembly is loaded into memory only if the user elects to view the application in that language."

This means that you develop your application in a default language and add flexibility to react with change in the locale. Say, for example, you developed your application in an en-US locale. Now, your application has multilingual support. When you deploy your code in, say, India, you want to show labels, messages shown in the national language which is other than English.

Satellite assemblies give this flexibility. You create any simple text file with translated strings, create resources, and put them into the bin\debug folder. That's it. The next time, your code will read the CurrentCulture property of the current thread and accordingly load the appropriate resource.

This is called the hub and spoke model. It requires that you place resources in specific locations so that they can be located and used easily. If you do not compile and name resources as expected, or if you do not place them in the correct locations, the common language runtime will not be able to locate them. As a result, the runtime uses the default resource set.

Creating a Satellite Assembly

  1. Create a folder with a specific culture name (for example, en-US) in the application's bin\debug folder.
  2. Create a .resx file in that folder. Place all translated strings into it.
  3. Create a .resources file by using the following command from the .NET command prompt. (localizationsample is the name of the application namespace. If your application uses a nested namespace structure like MyApp.YourApp.MyName.YourName as the type of namespace, just use the uppermost namespace for creating resources files—MyApp.)
  4. resgen Strings.en-US.resx LocalizationSample.
    al /embed:LocalizationSample.Strings.en-US.resources
       /out:LocalizationSample.resources.dll /c:en-US

    The above step will create two files, LocalizationSample.Strings.en-US.resources and LocalizationSample.resources.dll. Here, LocalizationSample is the name space of the application.

  5. In the code, find the user's language; for example, en-US. This is culture specific.
  6. Give the assembly name as the name of .resx file. In this case, it is Strings.

Using a Satellite Assembly

Follow these steps:

Thread.CurrentThread.CurrentCulture =
Thread.CurrentThread.CurrentUICulture =
   new CultureInfo(specCult);
ResourceManager resMgr =
   new ResourceManager(typeof(Form1).Namespace + "." +
                       asmName, this.GetType().Assembly);
btnTest.Text = resMgr.GetString("Jayant");

That's it. See how simple is it to create a satellite assembly and use it in your code.

Here's how to use a satellite assembly if your assembly is a strong named assembly. When you create an assembly with a string name, all the assemblies it refers to must have a strong name. This is true with a satellite assembly also. Here are the steps to create a strong named satellite assembly.

String Naming a Satellite Assembly

al /embed:ExploreDotNet2005.Strings.en-US.resources
   /out:ExploreDotNet2005.resources.dll /c:en-US
   /template:../ExploreDotNet2005.exe /keyfile:../../..

Remember that /template is very important because it inherits the parent assembly manifest, and the strong name key pair must be the same as that for the running assembly. I've tried using different strong names for satellite assembly and executing the assembly. but it throws an exception.

That's it, friends. In case of any queries, let me know.

About the Author

Jayant Kulkarni

Dear Friends, I'm from Pune and curently working with Symantec Corp. I'm having more than 7 years of exp in software field and have worked on areas like ASP.NET, C#, .NET remoting, web services, pocket pc applciations. I'm a brainbench certified software engineer in .NET framework, C#, ADO.NET and ASP.NET. If you like any of my articles or you want to suggest some changes and improve the way I code, write articles feel free to mail me at:



  • LSACreator

    Posted by Adam on 02/14/2013 03:33pm

    I found tool that could be useful when working with satellite assemblies. Link below. :)

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • On-demand Event Event Date: February 12, 2015 The evolution of systems engineering with the SysML modeling language has resulted in improved requirements specification, better architectural definition, and better hand-off to downstream engineering. Agile methods have proven successful in the software domain, but how can these methods be applied to systems engineering? Check out this webcast and join Bruce Powel Douglass, author of Real-Time Agility, as he discusses how agile methods have had a tremendous …

  • The mobile market is white hot. Building a well-crafted product development plan that addresses market research, strategy, design, and development will provide the greatest chance for success. Each phase of an app's lifecycle is critical to the its overall success and feeds into the next step of the process of product development for the app. This white paper examines the five key phases of mobile app creation, one by one, to understand how they work together to help create a successful mobile app.

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date