Пример #1
0
 /// <summary>
 /// Mounts resource container from configuration by loading the assemblies and collecting resources using AssemblyResourceCollector strategy
 /// </summary>
 private void mountResourceContainers()
 {
     this.Log.Info("Mounting resource containers");
     foreach (var mount in this.HostConfiguration.Mounts)
     {
         Log.DebugFormat("Mounting resource container for {{{0}}}", mount.Path);
         Assembly mountAssembly = Assembly.LoadFile(Path.GetFullPath(mount.Assembly));
         AssemblyResourceCollector collector = new AssemblyResourceCollector(mountAssembly);
         MountedResourceContainer resourceContainer = new MountedResourceContainer(collector.Collect(), mount.Path);
         HostService.MountResourceContainer(resourceContainer);
     }
 }
Пример #2
0
        public void Run()
        {
            this.Log.Debug("Collecting resources");
            IResourceCollector resourceCollector = new AssemblyResourceCollector(typeof(Program).Assembly);
            IEnumerable<CollectedResource> resources = resourceCollector.Collect();

            this.Log.Debug("Creating webservice");
            this.Service = new WebService(resources);
            //this.Service.ConfigureLogging(Common.Logging.LogManager.GetLogger(this.GetType()));
            //this.Service.Configure("localhost", "127.0.0.1", 80);

            this.Service.Start();
        }