开发者

SQL CLR project build fails using TFS - unable to resolve reference to assembly

开发者 https://www.devze.com 2023-03-06 02:11 出处:网络
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 (viaa database project in the so

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 o开发者_JAVA百科r 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!


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.)

0

精彩评论

暂无评论...
验证码 换一张
取 消