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 @ Tuesday, October 6, 2009 11:21 PM

Print

Comments on this entry:

# Process Service in Mongolia

Left by Process Service in Mongolia at 5/13/2013 12:04 PM
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.
«May»
SunMonTueWedThuFriSat
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678