需要在 SQL CLR 中进行远程处理
我必须使用外部服务处理 BLOB,该服务只能通过远程处理获得(!)。
因此,我必须注册一个引用 System.Runtime.Remoting.dll 的程序集。所以,我必须自己注册这个dll。我更喜欢使用最后一个框架,但至少 2.0 就足够了。
当我尝试时
CREATE ASSEMBLY [System.Runtime.Remoting]
FROM 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Runtime.Remoting.dll'
WITH PERMISSION_SET = UNSAFE
GO
它说:
创建装配体 “System.Runtime.Remoting”失败 因为组装 “System.Runtime.Remoting”失败 确认。检查是否引用了 程序集是最新且值得信赖的 (对于 external_access 或不安全) 在数据库中执行。 CLR 验证器 错误消息(如果有)将遵循此 留言
当我尝试时:
CREATE ASSEMBLY [System.Runtime.Remoting]
FROM 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Runtime.Remoting.dll'
WITH PERMISSION_SET = UNSAFE
GO
它说:
消息 10300,级别 16,状态 1,第 2 行 程序集“System.Web”引用 装配'system.enterpriseservices, 版本=2.0.0.0,文化=中性, 公钥令牌=b03f5f7f11d50a3a。', 当前不存在的 数据库。 SQL Server 尝试 定位并自动加载 引用相同的程序集 引用组件所在的位置 来自,但该操作失败 (原因:版本、文化或公众 键不匹配)。请加载 引用的程序集到当前 数据库并重试您的请求。
我应该如何解决这个问题?
问候,
I have to process BLOBs with an external service, that's available thru remoting only (!).
So, I have to register an assembly with a reference to System.Runtime.Remoting.dll. So, I have to register this dll itself. I'd prefer to use the last framework, but at least 2.0 is enough.
When I try
CREATE ASSEMBLY [System.Runtime.Remoting]
FROM 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Runtime.Remoting.dll'
WITH PERMISSION_SET = UNSAFE
GO
it says:
CREATE ASSEMBLY for assembly
'System.Runtime.Remoting' failed
because assembly
'System.Runtime.Remoting' failed
verification. Check if the referenced
assemblies are up-to-date and trusted
(for external_access or unsafe) to
execute in the database. CLR Verifier
error messages if any will follow this
message
When I try:
CREATE ASSEMBLY [System.Runtime.Remoting]
FROM 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Runtime.Remoting.dll'
WITH PERMISSION_SET = UNSAFE
GO
it says:
Msg 10300, Level 16, State 1, Line 2
Assembly 'System.Web' references
assembly 'system.enterpriseservices,
version=2.0.0.0, culture=neutral,
publickeytoken=b03f5f7f11d50a3a.',
which is not present in the current
database. SQL Server attempted to
locate and automatically load the
referenced assembly from the same
location where referring assembly came
from, but that operation has failed
(reason: version, culture or public
key mismatch). Please load the
referenced assembly into the current
database and retry your request.
How should I fix this?
Regards,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不要这样做。如果需要使用远程处理(或 Web 服务,或外部文件访问),请勿从 SQLCLR 内部处理 BLOB。从加载 BLOB 的外部应用程序处理 BLOB,连接到处理(使用远程处理或任何类似的东西),然后更新数据库。
Don't do it. Don't process your BLOBs from inside SQLCLR if it needs to use Remoting (or Web services, or external file access). Process your BLOBs from an external application that load the BLOB, connects to the processing (using remoting or anything similat) and then updates the database.