【问题标题】:SQL CLR project build fails using TFS - unable to resolve reference to assemblySQL CLR 项目使用 TFS 构建失败 - 无法解析对程序集的引用
【发布时间】:2011-08-26 15:09:40
【问题描述】:

我们有一个 VS2010 解决方案,其中包含一个 SQL CLR 项目,该项目本身具有对已在我们的开发数据库服务器上注册的第三方程序集的引用(通过解决方案中的数据库项目,该解决方案中有一个使用脚本来注册程序集从 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 文件夹?)。任何指导表示赞赏!

【问题讨论】:

    标签: visual-studio-2010 tfs msbuild sqlclr


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2011-07-11
      • 2013-04-25
      • 1970-01-01
      • 2021-11-25
      • 1970-01-01
      • 2011-04-01
      • 1970-01-01
      • 2014-06-17
      • 1970-01-01
      相关资源
      最近更新 更多