gpt4 book ai didi

sql-server - CLR 程序集说它找不到数据库中已存在的引用程序集

转载 作者:行者123 更新时间:2023-12-04 06:28:04 27 4
gpt4 key购买 nike

我有一个引用外部程序集的 CLR 项目。我首先创建了引用的程序集,如下所示:

CREATE ASSEMBLY [GraphClient]
FROM 'C:\Users\rknight\Desktop\GraphServerClientProject\GraphServerClient\GraphClient\GraphClient\bin\Debug\GraphClient.dll'
WITH PERMISSION_SET = UNSAFE

然后在我的 CLR 项目中,我能够在“SQL Server”选项卡下很好地引用它。构建了 CLR 项目并且它编译没有错误。但是当我创建新程序集时,出现错误:
CREATE ASSEMBLY [GraphCLR]
FROM 'C:\Users\rknight\Desktop\GraphServerClientProject\GraphServerClient\GraphClient\GraphCLR\bin\Debug\GraphCLR.dll'
WITH PERMISSION_SET = UNSAFE


Msg 10301, Level 16, State 1, Line 1
Assembly 'GraphCLR' references assembly 'graphclient, version=0.0.0.0, culture=neutral, publickeytoken=null.', 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: 2(The system cannot find the file specified.)). Please load the referenced assembly into the current database and retry your request.

最佳答案

我遇到了这个问题,我最终解决了它。我在 64 位服务器上引用了 x86 程序集。我将引用的程序集重建为 Any CPU,安装在服务器上,重新添加对项目的引用,将我的项目重建为 Any CPU,然后 然后 SQL Server 可以解析引用并安装程序集。

“您正在引用为错误平台构建的程序集”之类的消息会非常有用:)

关于sql-server - CLR 程序集说它找不到数据库中已存在的引用程序集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5784288/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com