File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,20 @@ public static class Initializer
2727 [ ModuleInitializer ]
2828 internal static void ModuleInitializer ( )
2929 {
30- var currentFolder = Path . GetDirectoryName ( Assembly . GetEntryAssembly ( ) . Location ) ;
30+ string currentFolder ;
31+
32+ var executingAssembly = Assembly . GetEntryAssembly ( ) ;
33+ //The GetEntryAssembly method can return null when a managed assembly has been loaded from an unmanaged application.
34+ //https://docs.microsoft.com/en-us/dotnet/api/system.reflection.assembly.getentryassembly?view=net-5.0
35+ if ( executingAssembly == null )
36+ {
37+ currentFolder = Path . GetDirectoryName ( typeof ( Initializer ) . Assembly . Location ) ;
38+ }
39+ else
40+ {
41+ currentFolder = Path . GetDirectoryName ( executingAssembly . Location ) ;
42+ }
43+
3144 var libCefPath = Path . Combine ( currentFolder , "libcef.dll" ) ;
3245
3346 if ( File . Exists ( libCefPath ) )
You can’t perform that action at this time.
0 commit comments