简体   繁体   English

msbuild错误在TFS中构建sql clr dll

[英]msbuild error building sql clr dll in TFS

We have SQL CLR dll that we developed quite a long time ago that we have been using. 我们已经使用了很久以前开发的SQL CLR dll。 Unfortunately it wasn't ever in our normal daily builds.We are going to be upgrade our sql server from 2008 R2 to 2014. So i opened the project and upgrade it to a visual studio 2013 project (we hadn't opened it for quite some time). 不幸的是,这并不是我们日常的日常构建。我们打算将sql server从2008 R2升级到2014。因此,我打开了该项目并将其升级到visual studio 2013项目(我们还没有打开它一段时间)。 I also upgrade the target framework from 3.5 to 4.5.1. 我还将目标框架从3.5升级到4.5.1。 Lastly i changed the target sql server version to 2014. I was able to build it locally. 最后,我将目标SQL Server版本更改为2014。我能够在本地构建它。 I then tried to add it to our TFS build and got the following error: 然后,我尝试将其添加到我们的TFS构建中,并出现以下错误:

E:\\Builds\\8\\TRSApps\\Dev\\Sources\\Shared Objects\\Components\\FrsSqlCLR\\VB Code\\FrsSqlCLR.vbproj (76): The imported project "C:\\Program Files (x86)\\MSBuild\\12.0\\bin\\amd64\\SqlServer.targets" was not found. E:\\ Builds \\ 8 \\ TRSApps \\ Dev \\ Sources \\ Shared Objects \\ Components \\ FrsSqlCLR \\ VB代码\\ FrsSqlCLR.vbproj(76):导入的项目“ C:\\ Program Files(x86)\\ MSBuild \\ 12.0 \\ bin \\ amd64找不到“ \\ SqlServer.targets”。 Confirm that the path in the declaration is correct, and that the file exists on disk. 确认声明中的路径正确,并且文件在磁盘上。

I was able to resolve the problem. 我能够解决问题。 I searched for "SqlServer.targets" locally and found it under the .net 3.5 framework folder (not under 4.x): C:\\Windows\\Microsoft.NET\\Framework\\v3.5 我在本地搜索“ SqlServer.targets”,并在.net 3.5 framework文件夹(不在4.x下)下找到它:C:\\ Windows \\ Microsoft.NET \\ Framework \\ v3.5

I just copied it to the location it was looking for it above and it fixed the problems which leads me to my questions: 我只是将其复制到上面要查找的位置,它解决了导致我提出问题的问题:

  1. Is TFS looking for SqlServer.targets in the correct location? TFS是否在正确的位置寻找SqlServer.targets? If so then why isn't SqlServer.targets there? 如果是这样,那为什么不存在SqlServer.targets?
  2. Is there something i need to install on the build machine? 我需要在构建机器上安装什么东西吗?
  3. Why is the file in the 3.5 framework folder and not in the 4.x framework folder 为什么文件在3.5 framework文件夹而不是4.x framework文件夹中

Though i was able to resolve it by copying it from the 3.5 framework folder it seem a kind of hacky solution. 虽然我能够通过从3.5 framework文件夹中复制它来解决它,但这似乎是一种棘手的解决方案。 I want the details so in the future when we upgrade our tfs server i have all the details. 我需要详细信息,因此在将来升级我们的tfs服务器时,我将掌握所有详细信息。

You need to install Visual Studio 2013 on the build server. 您需要在生成服务器上安装Visual Studio 2013。 Also Sql Server Data Tools for 2013. 也是2013年的Sql Server数据工具。

Once you have them on the build server it should build as is. 将它们放置在构建服务器上后,它应按原样构建。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM