Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElinor Fung <47805090+elinor-fung@users.noreply.github.com>2019-11-13 12:11:41 +0300
committerAlexander Köplinger <alex.koeplinger@outlook.com>2019-11-15 15:29:04 +0300
commit1f2f9b929b59955b4dc80a10c71ea59118797cee (patch)
tree6678c5ed75c2433b2ddb33876444ca5285c7c8f2 /netcore
parent3242b5f35422685c0454ccaed14c841ae520ca3a (diff)
Add tracing for handling of dependencies for Assembly.LoadFrom (#27833)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Diffstat (limited to 'netcore')
-rw-r--r--netcore/System.Private.CoreLib/shared/System/Reflection/Assembly.cs15
1 files changed, 14 insertions, 1 deletions
diff --git a/netcore/System.Private.CoreLib/shared/System/Reflection/Assembly.cs b/netcore/System.Private.CoreLib/shared/System/Reflection/Assembly.cs
index db7d10abfd9..27c81866438 100644
--- a/netcore/System.Private.CoreLib/shared/System/Reflection/Assembly.cs
+++ b/netcore/System.Private.CoreLib/shared/System/Reflection/Assembly.cs
@@ -258,7 +258,15 @@ namespace System.Reflection
{
// If the requestor assembly was not loaded using LoadFrom, exit.
if (!s_loadFromAssemblyList.Contains(requestorPath))
+ {
+#if CORECLR
+ if (AssemblyLoadContext.IsTracingEnabled())
+ {
+ AssemblyLoadContext.TraceAssemblyLoadFromResolveHandlerInvoked(args.Name, false, requestorPath, null);
+ }
+#endif // CORECLR
return null;
+ }
}
// Requestor assembly was loaded using loadFrom, so look for its dependencies
@@ -266,7 +274,12 @@ namespace System.Reflection
// Form the name of the assembly using the path of the assembly that requested its load.
AssemblyName requestedAssemblyName = new AssemblyName(args.Name!);
string requestedAssemblyPath = Path.Combine(Path.GetDirectoryName(requestorPath)!, requestedAssemblyName.Name + ".dll");
-
+#if CORECLR
+ if (AssemblyLoadContext.IsTracingEnabled())
+ {
+ AssemblyLoadContext.TraceAssemblyLoadFromResolveHandlerInvoked(args.Name, true, requestorPath, requestedAssemblyPath);
+ }
+#endif // CORECLR
try
{
// Load the dependency via LoadFrom so that it goes through the same path of being in the LoadFrom list.