Unity leggere la configurazione da uno specifico file

   1:  public static IUnityContainer GetContainerFromAnotherFile(string unityConfigName,string containerName)
   2:          {
   3:              UnityConfigurationSection section = GetUnityConfigSection();
   4:              UnityContainerElement configElement = new UnityContainerElement();
   5:              IUnityContainer container = new UnityContainer();
   6:              
   7:              var map = new ExeConfigurationFileMap();
   8:              map.ExeConfigFilename = unityConfigName;
   9:   
  10:              var config = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None);
  11:              section = (UnityConfigurationSection)config.GetSection("unity");
  12:              container = new UnityContainer();
  13:              section.Containers[containerName].Configure(container);
  14:              configElement.Configure(container);
  15:   
  16:              return container;
  17:   
  18:          }

posted @ mercoledì 7 ottobre 2009 02:21

Print

Comments on this entry:

# Process Service in Mongolia

Left by Process Service in Mongolia at 13/05/2013 15:04
Gravatar
We are conveying the law suits, complains, sending court orders and notices which demands them to serve the judicial document and legal papers against a person who might be somewhere else in the world.
Comments have been closed on this topic.
«aprile»
domlunmarmergiovensab
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011