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 @@ -129,9 +129,21 @@ private BuildInfo GatherBuildInfo()
129129 {
130130 var buildInfo = new BuildInfo ( ) ;
131131
132- var attributes = Assembly . GetEntryAssembly ( ) ? . GetCustomAttributes < AssemblyMetadataAttribute > ( ) . ToList ( ) ;
132+ var electronAssembly = Assembly . GetEntryAssembly ( ) ;
133133
134- if ( attributes ? . Count > 0 )
134+ if ( electronAssembly == null )
135+ {
136+ return buildInfo ;
137+ }
138+
139+ if ( electronAssembly . GetName ( ) . Name == "testhost" )
140+ {
141+ electronAssembly = AppDomain . CurrentDomain . GetData ( "ElectronTestAssembly" ) as Assembly ?? electronAssembly ;
142+ }
143+
144+ var attributes = electronAssembly . GetCustomAttributes < AssemblyMetadataAttribute > ( ) . ToList ( ) ;
145+
146+ if ( attributes . Count > 0 )
135147 {
136148 buildInfo . ElectronExecutable = attributes . FirstOrDefault ( e => e . Key == nameof ( buildInfo . ElectronExecutable ) ) ? . Value ;
137149 buildInfo . ElectronVersion = attributes . FirstOrDefault ( e => e . Key == nameof ( buildInfo . ElectronVersion ) ) ? . Value ;
You can’t perform that action at this time.
0 commit comments