Example #1
0
    public int ExecuteInAssemblyLoadContext()
    {
        int exitCode;

        AssemblyLoadContext.AppendPrivatePath(BasePath);

        // Execute the test.
        if (Assembly.ToLower().IndexOf(".exe") == -1 && Assembly.ToLower().IndexOf(".dll") == -1) // must be a simple name or fullname...
        {
            exitCode = AssemblyLoadContext.ExecuteAssemblyByName(Assembly, GetSplitArguments());
        }
        else
        {
            exitCode = AssemblyLoadContext.ExecuteAssembly(Assembly, GetSplitArguments());
        }

        return(exitCode);
    }