Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft.VisualStudio.SharePoint.targets (416): Could not load file or assembly 'Microsoft.VisualStudio.SharePoint.Designers.Model

I am trying to setup the build integration between tfs and sharepoint.

We have a separate build server. We have followed these steps and checked them for correctness 3 times. However on sharepoint builds, we keep having this error. And yes the files exists on the build server.

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SharePointTools\Microsoft.VisualStudio.SharePoint.targets (416): Could not load file or assembly 'Microsoft.VisualStudio.SharePoint.Designers.Models, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified

Please advice.

Update 1: 1. When I remove the .SLN from the build definition and add the csproj one by one, the build completes but I get this warning for each project (10 times) C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (610): The OutputPath property is not set for project 'Pwc.SP.DMS.CLF.CustomContentField.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform='Any CPU'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project

I set /p:IsPackaging=true however in the drop folder I only see log files, there are no wsps or dlls.

If I remove the csproj and add the .sln then I get this error again:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SharePointTools\Microsoft.VisualStudio.SharePoint.targets (416): Could not load file or assembly 'Microsoft.VisualStudio.SharePoint.Designers.Models, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified

like image 210
Luis Valencia Avatar asked Nov 01 '22 04:11

Luis Valencia


1 Answers

If you copied the assembly to the build server, you may not have copied all the assemblies that Microsoft.VisualStudio.SharePoint.Designers.Models depends on. I would use Reflector or some kind of disassembler to view the dependencies. Once you have them all there, you should stop seeing loading issues. Sometimes, the issue relates to the architecture of the process running on the build server.

I would manually build the solution or project using msbuild on the build server i.e.

msbuild a.sln /p:OutDir=e:\dir\ /p:Configuration=Release /p:Platform="Any CPU"

msbuild a.csproj /p:OutDir=e:\dir\ /p:Configuration=Release /p:Platform=AnyCPU

like image 193
Brandon Hawbaker Avatar answered Nov 09 '22 12:11

Brandon Hawbaker