File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
src/PowerShellEditorServices.Hosting Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 22// Licensed under the MIT License.
33
44using System ;
5+ using System . Diagnostics ;
56using System . IO ;
67using System . Reflection ;
78using System . Threading . Tasks ;
@@ -93,7 +94,11 @@ public static EditorServicesLoader Create(
9394
9495 AssemblyLoadContext . Default . Resolving += ( AssemblyLoadContext defaultLoadContext , AssemblyName asmName ) =>
9596 {
97+ #if DEBUG
98+ logger . Log ( PsesLogLevel . Diagnostic , $ "Assembly resolve event fired for { asmName } . Stacktrace:\n { new StackTrace ( ) } ") ;
99+ #else
96100 logger . Log ( PsesLogLevel . Diagnostic , $ "Assembly resolve event fired for { asmName } ") ;
101+ #endif
97102
98103 // We only want the Editor Services DLL; the new ALC will lazily load its dependencies automatically
99104 if ( ! string . Equals ( asmName . Name , "Microsoft.PowerShell.EditorServices" , StringComparison . Ordinal ) )
@@ -124,7 +129,11 @@ public static EditorServicesLoader Create(
124129 // Unlike in .NET Core, we need to be look for all dependencies in .NET Framework, not just PSES.dll
125130 AppDomain . CurrentDomain . AssemblyResolve += ( object sender , ResolveEventArgs args ) =>
126131 {
132+ #if DEBUG
133+ logger . Log ( PsesLogLevel . Diagnostic , $ "Assembly resolve event fired for { args . Name } . Stacktrace:\n { new StackTrace ( ) } ") ;
134+ #else
127135 logger . Log ( PsesLogLevel . Diagnostic , $ "Assembly resolve event fired for { args . Name } ") ;
136+ #endif
128137
129138 var asmName = new AssemblyName ( args . Name ) ;
130139 var dllName = $ "{ asmName . Name } .dll";
You can’t perform that action at this time.
0 commit comments