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 2
2
// Licensed under the MIT License.
3
3
4
4
using System ;
5
+ using System . Diagnostics ;
5
6
using System . IO ;
6
7
using System . Reflection ;
7
8
using System . Threading . Tasks ;
@@ -93,7 +94,11 @@ public static EditorServicesLoader Create(
93
94
94
95
AssemblyLoadContext . Default . Resolving += ( AssemblyLoadContext defaultLoadContext , AssemblyName asmName ) =>
95
96
{
97
+ #if DEBUG
98
+ logger . Log ( PsesLogLevel . Diagnostic , $ "Assembly resolve event fired for { asmName } . Stacktrace:\n { new StackTrace ( ) } ") ;
99
+ #else
96
100
logger . Log ( PsesLogLevel . Diagnostic , $ "Assembly resolve event fired for { asmName } ") ;
101
+ #endif
97
102
98
103
// We only want the Editor Services DLL; the new ALC will lazily load its dependencies automatically
99
104
if ( ! string . Equals ( asmName . Name , "Microsoft.PowerShell.EditorServices" , StringComparison . Ordinal ) )
@@ -124,7 +129,11 @@ public static EditorServicesLoader Create(
124
129
// Unlike in .NET Core, we need to be look for all dependencies in .NET Framework, not just PSES.dll
125
130
AppDomain . CurrentDomain . AssemblyResolve += ( object sender , ResolveEventArgs args ) =>
126
131
{
132
+ #if DEBUG
133
+ logger . Log ( PsesLogLevel . Diagnostic , $ "Assembly resolve event fired for { args . Name } . Stacktrace:\n { new StackTrace ( ) } ") ;
134
+ #else
127
135
logger . Log ( PsesLogLevel . Diagnostic , $ "Assembly resolve event fired for { args . Name } ") ;
136
+ #endif
128
137
129
138
var asmName = new AssemblyName ( args . Name ) ;
130
139
var dllName = $ "{ asmName . Name } .dll";
You can’t perform that action at this time.
0 commit comments