diff --git a/src/ElectronNET.API/Runtime/StartupManager.cs b/src/ElectronNET.API/Runtime/StartupManager.cs index a405a6e..fd17d26 100644 --- a/src/ElectronNET.API/Runtime/StartupManager.cs +++ b/src/ElectronNET.API/Runtime/StartupManager.cs @@ -128,9 +128,21 @@ { var buildInfo = new BuildInfo(); - var attributes = Assembly.GetEntryAssembly()?.GetCustomAttributes().ToList(); + var electronAssembly = Assembly.GetEntryAssembly(); - if (attributes?.Count > 0) + if (electronAssembly == null) + { + return buildInfo; + } + + if (electronAssembly.GetName().Name == "testhost") + { + electronAssembly = AppDomain.CurrentDomain.GetData("ElectronTestAssembly") as Assembly ?? electronAssembly; + } + + var attributes = electronAssembly.GetCustomAttributes().ToList(); + + if (attributes.Count > 0) { buildInfo.ElectronExecutable = attributes.FirstOrDefault(e => e.Key == nameof(buildInfo.ElectronExecutable))?.Value; buildInfo.ElectronVersion = attributes.FirstOrDefault(e => e.Key == nameof(buildInfo.ElectronVersion))?.Value;