Unity configuration in Silverlight

Dec 1, 2008 at 11:15 PM

I have seen documentation how to do Unity configuration from the file for WPF app.
Is it possible for Silverlight?
What will be default a config file - equivalent of App.config of WPF app?
How to use alternative configuration sources  in Silverlight?




Dec 2, 2008 at 1:54 PM



Currently Unity does not officially support Silverlight and therefore it does not provide support to configure the container from a file.

To customize your container’s configuration, you will need to override the ConfigureContainer method in your Bootstrapper class with the custom configuration for your application’s container via code.


Perhaps you could find useful the following article (from Composite Application Guidance for WPF documentation) to understand the container configuration better:

·         Bootstrapper


Regarding your other questions, it could be considered that the “equivalent” of the App.config.xml file from Composite WPF is the ModulesCatalog.xaml. In that file you can specify the modules to be loaded and how they will be loaded (on demand or when the application starts for example).


Another way to configure the modules that will be loaded is via code.


This two cases are covered by the Modularity Quickstarts released in the latest Prism-v2 drop (drop 6):

·         Static Module Loading QuickStart (Code)

·         Remote Module Loading QuickStart (ModuleCatalog)


Remember: This is not necessarily the final design of Modularity in Prism-v2, as the team will likely make some modifications to it for future drops .


Please let me know if this helps.


Damian Schenkelman


Apr 23, 2010 at 3:59 PM
Edited Apr 23, 2010 at 4:01 PM

hi, There is a new project on codeplex currently targeting Silverlight 3 and wpf that supports unity configuration via xaml resource files. Its name is sonicnet.codeplex.com. Check it out.

I hope this helps