we ran into a problem while using the Red-Gate SQL Packager 220.127.116.11
We built a package and tried running it on a server where the packager is supposed to create a new database. The problem occurred when the packager tried to install a .net assembly file(dll) into the newly created database.
It threw an error that said
“CREATE ASSEMBLY for assembly 'Delta.SQLCLR' failed because assembly 'Delta.SQLCLR' is not authorized for PERMISSION_SET = UNSAFE. The assembly is authorized when either of the following is true: the database owner (DBO) has UNSAFE ASSEMBLY permission and the database has the TRUSTWORTHY database property on; or the assembly is signed with a certificate or an asymmetric key that has a corresponding login with UNSAFE ASSEMBLY permission.”
This could be fixed by using the statement “SET TRUSTWORTHY ON” on the newly created db.
But when we made the above script a part of the preSQL script and ran the packager in command line, it did not seem to have executed the above script and came back with the same error.