This repository was archived by the owner on Jun 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -50,18 +50,23 @@ public GitHubPackage(IServiceProvider serviceProvider)
5050
5151 protected override async Task InitializeAsync ( CancellationToken cancellationToken , IProgress < ServiceProgressData > progress )
5252 {
53- var packageVersion = GetType ( ) . Assembly . GetName ( ) . Version ;
54- var hostVersionInfo = System . Diagnostics . Process . GetCurrentProcess ( ) . MainModule . FileVersionInfo ;
55- log . Information ( "Initializing GitHub Extension v{PackageVersion} in {$FileDescription} ({$ProductVersion})" ,
56- packageVersion , hostVersionInfo . FileDescription , hostVersionInfo . ProductVersion ) ;
57-
53+ LogVersionInformation ( ) ;
5854 await base . InitializeAsync ( cancellationToken , progress ) ;
5955
6056 await GetServiceAsync ( typeof ( IUsageTracker ) ) ;
6157
6258 InitializeMenus ( ) . Forget ( ) ;
6359 }
6460
61+ void LogVersionInformation ( )
62+ {
63+ // This is intentionally light-weight and avoids using MEF (otherwise we code use IProgram).
64+ var packageVersion = GetType ( ) . Assembly . GetName ( ) . Version ;
65+ var hostVersionInfo = System . Diagnostics . Process . GetCurrentProcess ( ) . MainModule . FileVersionInfo ;
66+ log . Information ( "Initializing GitHub Extension v{PackageVersion} in {$FileDescription} ({$ProductVersion})" ,
67+ packageVersion , hostVersionInfo . FileDescription , hostVersionInfo . ProductVersion ) ;
68+ }
69+
6570 async Task InitializeMenus ( )
6671 {
6772 var menus = await GetServiceAsync ( typeof ( IMenuProvider ) ) as IMenuProvider ;
You can’t perform that action at this time.
0 commit comments