Error while submitting workflow on GP 2016R2

An error occurred in the Microsoft .NET Framework while trying to load assembly id 65626. The server may be running out of resources, or the assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE

We have installed and upgraded the GP from lower version to the upper version of the GP. We have restored the SQL server on the new installed SQL server. Once we upgraded the GP2010 to GP 2016R2 without any error and while testing the workflow it was giving an error. To solve this error you need to run the one store procedure against DYNAMICS Database and this error will be solved.

 EXEC DYNAMICS.dbo.wfDeployClrAssemblies