0

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.

coding4fun
  • 8,038
  • 13
  • 58
  • 85

1 Answers1

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.

  • While i'm assuming this is the correct answer its not really a good solution. Having to install Visual Studio 2013 and SSDT on the build server is kind of a hacky solution. What if you were using TFS online? Microsoft really come up with a better way. Ideally you should never have to install anything like this on the build servers. – coding4fun Apr 23 '15 at 13:49
  • No it is not hackie. Your build servers should reflect your development environments. Whatever your developers have to build locally is what you should have on the build agent. VSO (TFS online) have all these bits pre-installed for you. – MrHinsh - Martin Hinshelwood Apr 23 '15 at 19:08