Dev Dev - 3 months ago 19
SQL Question

How to grant the database owner (DBO) the EXTERNAL ACCESS ASSEMBLY permission?

When I try to create assembly in SQL 2008 from .Net assembly (.Net 3.5) I am getting the below error, error says that I have to set either of the below properties as true, how can I do that?


The database owner (DBO) has EXTERNAL ACCESS ASSEMBLY permission as
TRUE

The database has the TRUSTWORTHY database property on

The assembly is signed with a certificate or an asymmetric key that
has a corresponding login with EXTERNAL ACCESS ASSEMBLY permission.


The complete error is below,


CREATE ASSEMBLY for assembly 'SQLLogger' failed because assembly 'SQLLogger' is not authorized for PERMISSION_SET = EXTERNAL_ACCESS. The assembly is authorized when either of the following is true: the database owner (DBO) has EXTERNAL ACCESS 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 EXTERNAL ACCESS ASSEMBLY permission.


Thanks in advance!

Answer Source

You must set these settings in the project file! When you right click on your project, click the Database Settings from the project configuration and select the miscellaneous tab. You should see something similar to what I have here: Project Settings

This is the same question as: Error Running CLR Stored Proc