系统安全.HostProtectionException:尝试执行CLR主机禁止的操作。

5
我在我的SQLCLR项目中使用线程,当我尝试运行我的自定义函数时,出现以下错误。我该怎么做才能在我的项目中启用并发库和await/async等线程操作?

Msg 6522, Level 16, State 1, Line 4
在执行自定义例程或聚合“CalculateInfo”时出现 .NET Framework 错误:
  System.Security.HostProtectionException: 尝试执行 CLR 主机禁止的操作。

    受保护的资源(仅在完全信任时可用)是: All
    所需的资源是: Synchronization, ExternalThreading

    System.Security.HostProtectionException:
        at UserDefinedFunctions.getData()
        at UserDefinedFunctions.CalculateInfo()

2个回答

18

0

将权限设置为无限制。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接