coding4fun
coding4fun

Reputation: 8209

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. 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). I also upgrade the target framework from 3.5 to 4.5.1. Lastly i changed the target sql server version to 2014. I was able to build it locally. I then tried to add it to our TFS build and got the following error:

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

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? If so then why isn't SqlServer.targets there?
  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

Though i was able to resolve it by copying it from the 3.5 framework folder it seem a kind of hacky solution. I want the details so in the future when we upgrade our tfs server i have all the details.

Upvotes: 0

Views: 174

Answers (1)

You need to install Visual Studio 2013 on the build server. Also Sql Server Data Tools for 2013.

Once you have them on the build server it should build as is.

Upvotes: 1

Related Questions