If you have CustomAcitivity registered with Isolation Mode as Sandbox and you are getting error in Custom Activity execution as
Error in CustomActivity : {Activity Class}: That assembly does not allow partially trusted callers.
Then check if you code using using HttpUtility.ParseQueryString method. As per documentation
“The ParseQueryString method uses query strings that might contain user input, which is a potential security threat.”
Hence this code cannot be executed under Sandbox mode.
HTH