static ApplicationPartManagerExtensions()
        {
            //we use the default file provider, since the DI isn't initialized yet
            _fileProvider = CommonHelper.DefaultFileProvider;

            _baseAppLibraries = new List <string>();

            //get all libraries from /bin/{version}/ directory
            _baseAppLibraries.AddRange(_fileProvider.GetFiles(AppDomain.CurrentDomain.BaseDirectory, "*.dll")
                                       .Select(fileName => _fileProvider.GetFileName(fileName)));

            //get all libraries from base site directory
            if (!AppDomain.CurrentDomain.BaseDirectory.Equals(Environment.CurrentDirectory, StringComparison.InvariantCultureIgnoreCase))
            {
                _baseAppLibraries.AddRange(_fileProvider.GetFiles(Environment.CurrentDirectory, "*.dll")
                                           .Select(fileName => _fileProvider.GetFileName(fileName)));
            }

            //get all libraries from refs directory
            //var refsPathName = _fileProvider.Combine(Environment.CurrentDirectory, NopPluginDefaults.RefsPathName);
            //if (_fileProvider.DirectoryExists(refsPathName))
            //{
            //    _baseAppLibraries.AddRange(_fileProvider.GetFiles(refsPathName, "*.dll")
            //        .Select(fileName => _fileProvider.GetFileName(fileName)));
            //}
        }
Esempio n. 2
0
 public WebHelper(HostingConfig hostingConfig,
                  IActionContextAccessor actionContextAccessor,
                  IHostApplicationLifetime hostApplicationLifetime,
                  IHttpContextAccessor httpContextAccessor,
                  IAnyFileProvider fileProvider,
                  IUrlHelperFactory urlHelperFactory)
 {
     _hostingConfig           = hostingConfig;
     _actionContextAccessor   = actionContextAccessor;
     _hostApplicationLifetime = hostApplicationLifetime;
     _httpContextAccessor     = httpContextAccessor;
     _fileProvider            = fileProvider;
     _urlHelperFactory        = urlHelperFactory;
 }
Esempio n. 3
0
 public WebAppTypeFinder(IAnyFileProvider fileProvider = null) : base(fileProvider)
 {
 }
Esempio n. 4
0
 public AppDomainTypeFinder(IAnyFileProvider fileProvider = null)
 {
     _fileProvider = fileProvider ?? CommonHelper.DefaultFileProvider;
 }