Products: fixed loading modules
This commit is contained in:
parent
6b25d1e98c
commit
8f8d9c99fc
@ -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))
|
||||
|
@ -19,7 +19,10 @@
|
||||
"region": "test",
|
||||
"test": true
|
||||
},
|
||||
"products": "../../products"
|
||||
"products": {
|
||||
"folder": "../../products",
|
||||
"subfolder": "Server"
|
||||
}
|
||||
},
|
||||
"license": {
|
||||
"file": {
|
||||
|
@ -16,6 +16,9 @@
|
||||
"core": {
|
||||
"base-domain": "localhost",
|
||||
"machinekey": "1VVAepxpW8f7",
|
||||
"products": "../products"
|
||||
"products": {
|
||||
"folder": "../products",
|
||||
"subfolder": "server"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user