TFS Build 2010 - Custom Binary Location and ShareP

2019-07-21 15:09发布

问题:

I'm building a solution using TFS Build 2010. This solution has multiple projects and one of the projects is SharePoint.

I want TFS Build to put binaries for each project in its own folder (i.e. customized binary folder). So I followed the instructions from MSDN and it works.

Now the challenge is that I'm not able to generate a WSP file with the customized binary folder (note that I'm able to generate WSP without the customized binary folder). I'm getting this error:

C:\\..\..\Microsoft.VisualStudio.SharePoint.targets (389): Unable to get the assembly for SharePoint Project Item "Layouts".

I think TFS Build/MSbuild is not able to locate the correct assembly because I changed the "OutputPath" value to achieve customized binary folders.

回答1:

You are going to have to update the Microsoft.VisualStudio.SharePoint.targets file. This file is located in the folder C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\SharePointTools\ on the build server.

Go to line number 366: <CreateSharePointProjectService Configuration=...

Change the attribute OutDir="$(TeamBuildOutDir)" to OutDir="$(TargetDir)" and save the file.

I have a blog post on this topic with screenshots.