Merge pull request #2684 from sbwalker/dev
add defensive logic to Oqtane.Client for loading modules on which have not declared all dependencies on WebAssembly
This commit is contained in:
commit
7d4cd04ce9
@ -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…
x
Reference in New Issue
Block a user