Beispiel #1
0
        public BaseDirectoryAssemblyContainer()
        {
            var directoryInfo = new DirectoryInfo("./".FullPath());

            foreach (var fileInfo in directoryInfo.GetFiles("*.dll", SearchOption.TopDirectoryOnly))
            {
                Assemblies = Assemblies.Append(Assembly.LoadFile(fileInfo.FullName));
            }

            foreach (var fileInfo in directoryInfo.GetFiles("*.exe", SearchOption.TopDirectoryOnly))
            {
                Assemblies = Assemblies.Append(Assembly.LoadFile(fileInfo.FullName));
            }
        }
        public HttpServerAssemblyContainer()
        {
            Directory = GetRootAssemblyDirectory(Assembly.GetExecutingAssembly().Location);

            foreach (var df in Directory.GetDirectories())
            {
                var i = df.GetDirectories().OrderByDescending(x => x.LastWriteTime).FirstOrDefault();
                if (i != null)
                {
                    foreach (var fileInfo in i.GetFiles("*.dll", SearchOption.TopDirectoryOnly))
                    {
                        Assemblies = Assemblies.Append(Assembly.LoadFile(fileInfo.FullName));
                    }
                }
            }
        }