使用 TFS SQL CLR 项目构建失败 - 无法解析对程序集的引用

发布于 2024-11-07 06:01:51 字数 1284 浏览 6 评论 0原文

我们有一个 VS2010 解决方案,其中包含一个 SQL CLR 项目,该项目本身引用了已在我们的开发数据库服务器上注册的第三方程序集(通过解决方案中的数据库项目,该项目具有一个脚本,用于使用 CREATE ASSEMBLY 注册程序集) varbinary 文字)。

当我们尝试通过 TFS 运行构建时,但是 CLR 项目无法构建,因为它无法找到对程序集的引用(下面的错误消息)。

ResolveSQLCLRReferences:
  Primary reference "Telerik_Web_UI_RecurrenceEngine".
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\TeamData\Microsoft.Data.Schema.SqlClr.targets(147,7): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Telerik_Web_UI_RecurrenceEngine". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [..]
      For SearchPath "xx\obj\sqlclr".
      Considered "xx\obj\sqlclr\Telerik_Web_UI_RecurrenceEngine.dll", but it didn't exist.
      Considered "xx\obj\sqlclr\Telerik_Web_UI_RecurrenceEngine.exe", but it didn't exist.
ResolveAssemblyReferences:
  Ignoring "Telerik_Web_UI_RecurrenceEngine" because it has a non-empty subtype "SQLCLR".

当通过 VS 构建/部署时,一切正常。我注意到我本地的 obj\sqlcr 文件夹中有所需的 DLL 文件,我认为该文件是通过对 SQL Server 上程序集的项目引用以某种方式生成的。

我们是否需要签入此文件以便构建服务器可以找到它,或者是否有某种方法使 msbuild 连接到数据库服务器来解析引用?

或者我们应该从 DB 项目中的文件(而不是 varbinary 文字)注册程序集,然后让 CLR 项目引用它? (不知道如何,手动复制到 \obj\sqclr 文件夹也许?)。任何指导表示赞赏!

We have a VS2010 Solution which contains a SQL CLR project which itself has a reference to a third party assembly that has been registered on our development DB server (via a database project in the solution which has a script to register the assembly using CREATE ASSEMBLY from a varbinary literal).

When we try and run a build through TFS however the CLR project fails to build as it is unable to locate the reference to the assembly (error message below)

ResolveSQLCLRReferences:
  Primary reference "Telerik_Web_UI_RecurrenceEngine".
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\TeamData\Microsoft.Data.Schema.SqlClr.targets(147,7): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Telerik_Web_UI_RecurrenceEngine". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [..]
      For SearchPath "xx\obj\sqlclr".
      Considered "xx\obj\sqlclr\Telerik_Web_UI_RecurrenceEngine.dll", but it didn't exist.
      Considered "xx\obj\sqlclr\Telerik_Web_UI_RecurrenceEngine.exe", but it didn't exist.
ResolveAssemblyReferences:
  Ignoring "Telerik_Web_UI_RecurrenceEngine" because it has a non-empty subtype "SQLCLR".

When building/deploying through VS it is fine. I notice that I have the required DLL file in my obj\sqlcr folder locally which I assume is somehow generated from the project reference to the assembly on SQL Server.

Do we need to check in this file so that the build server can find it or is there some way of making msbuild connect to a database server to resolve the reference?

Or should we be registering the assembly from a file in the DB project (rather than a varbinary literal) and then get the CLR project to reference that? (not sure how, manual copy to the \obj\sqclr folder maybe?). Any guidance appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清音悠歌 2024-11-14 06:01:51

另一种方法是在其他项目文件中签入该文件,但您必须确保也可以在 Team Build 服务器上找到该文件引用。

由于这是第三方库 dll,我相信它不会经常更改,因此将 dll 放置在 Team Build 服务器的 GAC 中也可能有效。 (......并且是一个更干净的解决方案。)

Checkin in the file among other project files can be an alternative but you must be sure that the file reference can be found on Team Build server also.

Since this is a third parth library dll, I believe it does not change often so placing the dll in the Team Build server's GAC might also work. (...and is a much cleaner solution.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文