Products: fixed loading modules

This commit is contained in:
pavelbannov 2019-07-10 12:25:46 +03:00
parent 6b25d1e98c
commit 8f8d9c99fc
3 changed files with 10 additions and 4 deletions

View File

@ -25,7 +25,7 @@ namespace ASC.Common.DependencyInjection
{
public static IContainer AddAutofac(this IServiceCollection services, IConfiguration configuration, string currentDir)
{
var productsDir = Path.GetFullPath(Path.Combine(currentDir, configuration["core:products"]));
var productsDir = Path.GetFullPath(Path.Combine(currentDir, configuration["core:products:folder"]));
var module = new ConfigurationModule(configuration);
var builder = new ContainerBuilder();
builder.RegisterModule(module);
@ -68,7 +68,7 @@ namespace ASC.Common.DependencyInjection
void LoadAssembly(string type)
{
var dll = type.Substring(type.IndexOf(",") + 1).Trim();
var productPath = Path.Combine(productsDir, dll);
var productPath = Path.Combine(productsDir, dll, configuration["core:products:subfolder"]);
var path = GetPath(Path.Combine(productPath, "bin"), dll, SearchOption.AllDirectories) ?? GetPath(productPath, dll, SearchOption.TopDirectoryOnly);
if (!string.IsNullOrEmpty(path))

View File

@ -19,7 +19,10 @@
"region": "test",
"test": true
},
"products": "../../products"
"products": {
"folder": "../../products",
"subfolder": "Server"
}
},
"license": {
"file": {

View File

@ -16,6 +16,9 @@
"core": {
"base-domain": "localhost",
"machinekey": "1VVAepxpW8f7",
"products": "../products"
"products": {
"folder": "../products",
"subfolder": "server"
}
}
}