From 120d41e5c709f02e61ce2cf43a3288e8576a9f14 Mon Sep 17 00:00:00 2001 From: Jaliya Udagedara Date: Wed, 19 Dec 2018 05:10:54 +1300 Subject: [PATCH] Added what TPA is. (dotnet/core-setup#4848) * Added what TPA is. * Updated code snippet. * Fix typo Commit migrated from https://github.com/dotnet/core-setup/commit/12dec873093a27aa294807fcf85e379aaf93e344 --- docs/installer/design-docs/host-startup-hook.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/installer/design-docs/host-startup-hook.md b/docs/installer/design-docs/host-startup-hook.md index c95f4c5..7061383 100644 --- a/docs/installer/design-docs/host-startup-hook.md +++ b/docs/installer/design-docs/host-startup-hook.md @@ -68,11 +68,11 @@ centralized, while still allowing user code to do its own thing if it so desires. The producer of `StartupHook.dll` needs to ensure that -`StartupHook.dll` is compatible with the dependencies specified in the -main application's deps.json, since those dependencies are put on the -TPA list during the runtime startup, before `StartupHook.dll` is -loaded. This means that `StartupHook.dll` needs to built against the -same or lower version of .NET Core than the app. +`StartupHook.dll` is compatible with the dependencies specified in the +main application's deps.json, since those dependencies are put on the +Trusted Platform Assemblies (TPA) list during the runtime startup, +before `StartupHook.dll` is loaded. This means that `StartupHook.dll` +needs to be built against the same or lower version of .NET Core than the app. ## Example @@ -102,9 +102,9 @@ namespace SharedHostPolicy { public static Assembly LoadAssemblyFromSharedLocation(AssemblyLoadContext context, AssemblyName assemblyName) { - string sharedAssemblyPath = // find assemblyName in shared location... + string sharedAssemblyPath = ""; // find assemblyName in shared location... if (sharedAssemblyPath != null) - return AssemblyLoadContext.Default.LoadFromAssemblyPath(sharedAssemblyPath) + return AssemblyLoadContext.Default.LoadFromAssemblyPath(sharedAssemblyPath); return null; } } @@ -230,4 +230,4 @@ be defined either in the app or within the first hook that uses it: The type should be made `internal` to prevent exposing it as API surface to any managed code that happens to have access to the startup -hook dll. However, the feature will also work if the type is `public`. \ No newline at end of file +hook dll. However, the feature will also work if the type is `public`. -- 2.7.4