<data name="Argument_InvalidSerializedString" xml:space="preserve">
<value>The specified serialized string '{0}' is not supported.</value>
</data>
- <data name="Argument_InvalidStartupHookSyntax" xml:space="preserve">
- <value>The syntax of the startup hook variable was invalid.</value>
- </data>
<data name="Argument_InvalidStartupHookSignature" xml:space="preserve">
<value>The signature of the startup hook '{0}' in assembly '{1}' was invalid. It must be 'public static void Initialize()'.</value>
</data>
string startupHookPart = startupHookParts[i];
if (string.IsNullOrEmpty(startupHookPart))
{
+ // Leave the slot in startupHooks empty (nulls for everything). This is simpler than shifting and resizing the array.
continue;
}
// "static void Initialize()" method.
private static void CallStartupHook(StartupHookNameOrPath startupHook)
{
- Debug.Assert(startupHook.Path != null || startupHook.AssemblyName != null);
-
Assembly assembly;
try
{
Debug.Assert(Path.IsPathFullyQualified(startupHook.Path));
assembly = AssemblyLoadContext.Default.LoadFromAssemblyPath(startupHook.Path);
}
- else
+ else if (startupHook.AssemblyName != null)
{
Debug.Assert(startupHook.AssemblyName != null);
assembly = AssemblyLoadContext.Default.LoadFromAssemblyName(startupHook.AssemblyName);
}
+ else
+ {
+ // Empty slot - skip it
+ return;
+ }
}
catch (Exception assemblyLoadException)
{