add defensive logic to Oqtane.Client for loading modules on which have not declared all dependencies on WebAssembly
This commit is contained in:
parent
04c0b9d37d
commit
497ef1750b
|
@ -198,6 +198,8 @@ namespace Oqtane.Client
|
|||
private static void RegisterModuleServices(Assembly assembly, IServiceCollection services)
|
||||
{
|
||||
// dynamically register module scoped services
|
||||
try
|
||||
{
|
||||
var implementationTypes = assembly.GetInterfaces<IService>();
|
||||
foreach (var implementationType in implementationTypes)
|
||||
{
|
||||
|
@ -208,8 +210,15 @@ namespace Oqtane.Client
|
|||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// could not interrogate assembly - likely missing dependencies
|
||||
}
|
||||
}
|
||||
|
||||
private static void RegisterClientStartups(Assembly assembly, IServiceCollection services)
|
||||
{
|
||||
try
|
||||
{
|
||||
var startUps = assembly.GetInstances<IClientStartup>();
|
||||
foreach (var startup in startUps)
|
||||
|
@ -217,6 +226,11 @@ namespace Oqtane.Client
|
|||
startup.ConfigureServices(services);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// could not interrogate assembly - likely missing dependencies
|
||||
}
|
||||
}
|
||||
|
||||
private static async Task SetCultureFromLocalizationCookie(IServiceProvider serviceProvider)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user