System.Security.HostProtectionException:尝试执行CLR主机禁止的操作

达斯·维甘

我在SQLCLR项目中使用线程,尝试运行用户定义的函数时出现以下错误。如何在项目中启用诸如并行库和等待/异步之类的线程处理功能?

消息6522,级别16,状态1,第4
行在执行用户定义的例程或聚合“ CalculateInfo”期间发生.NET Framework错误:
  System.Security.HostProtectionException:尝试执行CLR主机禁止的操作。

    受保护的资源(仅在完全信任的情况下可用)是:全部
    所需资源是:同步,ExternalThreading

    System.Security.HostProtectionException:
        位于UserDefinedFunctions.CalculateInfo()
        处的UserDefinedFunctions.getData()

所罗门·鲁兹基

正如您在其他问题中指出的那样,在数据库中创建程序集时部署SQLCLR项目失败将导致以下错误:

ALTER ASSEMBLY [AssemblyName]
   WITH PERMISSION_SET = UNSAFE;

有关一般使用SQLCLR的更多信息,请访问:SQLCLR信息

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

具有CLR功能的System.Security.SecurityException

System.Security.Claims丢失

System.Security.Cryptography与PCLCrypto

System.Security.Claims missing

VBScript错误5尝试使用'System.Security.Cryptography.SHA512Managed'计算sha512

尝试基于信任级别上载文件时出现System.Security.Permissions.FileIOPermission错误

System.Security.Cryptography.CryptographicException:不支持所请求的操作。Windows Server 2012

找不到System.Security.Cryptography

System.Security.Cryptography.CryptographicException:错误的数据

运行时错误 System.Security.Cryptography.CryptographicException: '错误数据。' 在 vb.net 中尝试导入 RSA 参数时

.NET Standard 2.0和System.Security.Cryptography.ProtectedData.Protect

无法加载类型'System.Net.Security.SslStream'

mscorlib 5.0.5.0中缺少System.Security.Cryptography.RSA

私钥引发了System.Security.Cryptography.CryptographicException类型的异常

Ubuntu 16.04上的System.Security.Cryptography.Csp

写入事件日志时发生System.Security.SecurityException

System.Security.Claims.ClaimType角色不匹配

TwilioRequestValidator中的瞬时System.Security.Cryptography.CryptographicException

[System.Web.Security.Membership] :: GeneratePassword()-类型未找到

System.Security.Cryptography的DeriveKeyFromHash()实际做什么?

在VS中分支后,Silverlight System.Security.VerifictionException

System.Security.Cryptography是否使用SIMD优化?

System.Security.Cryptography.OpenSsl 如何调用 OpenSSL 函数?

创建ICryptoTransform时出现System.Security.CryptpgraphicUnexpectedOperationException

System.Security.Cryptography.CryptographicException:'Cryptography_OAEPDecoding'[已解决]

xamarin:无法解析程序集:System.Security

我有这个错误 System.ServiceModel.Security.MessageSecurityException

禁止的403-Spring Security

无法将类型为“ System.Security.Claims.ClaimsIdentity”的对象转换为类型为“ System.Security.Principal.WindowsIdentity”的对象