File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
src/ElectronNET.API/Runtime Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -128,9 +128,21 @@ private BuildInfo GatherBuildInfo()
128128 {
129129 var buildInfo = new BuildInfo ( ) ;
130130
131- var attributes = Assembly . GetEntryAssembly ( ) ? . GetCustomAttributes < AssemblyMetadataAttribute > ( ) . ToList ( ) ;
131+ var electronAssembly = Assembly . GetEntryAssembly ( ) ;
132132
133- if ( attributes ? . Count > 0 )
133+ if ( electronAssembly == null )
134+ {
135+ return buildInfo ;
136+ }
137+
138+ if ( electronAssembly . GetName ( ) . Name == "testhost" )
139+ {
140+ electronAssembly = AppDomain . CurrentDomain . GetData ( "ElectronTestAssembly" ) as Assembly ?? electronAssembly ;
141+ }
142+
143+ var attributes = electronAssembly . GetCustomAttributes < AssemblyMetadataAttribute > ( ) . ToList ( ) ;
144+
145+ if ( attributes . Count > 0 )
134146 {
135147 buildInfo . ElectronExecutable = attributes . FirstOrDefault ( e => e . Key == nameof ( buildInfo . ElectronExecutable ) ) ? . Value ;
136148 buildInfo . ElectronVersion = attributes . FirstOrDefault ( e => e . Key == nameof ( buildInfo . ElectronVersion ) ) ? . Value ;
You can’t perform that action at this time.
0 commit comments