2

I am trying to build an Azure cloud service with multiple roles and a webAPI project on team city. The solution builds fine on VS 2013 but fails on team city with the folowing error.

[PrepareRoleItems] C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Windows Azure Tools\2.5\Microsoft.WindowsAzure.targets(1326, 5): error MSB4096: The item "C:\TeamCity\buildAgent\work\96a0cadf65a06070\projWebAPI\projWebAPI.csproj" in item list "ProjectReferenceWithConfiguration" does not define a value for metadata "Name".  In order to use this metadata, either qualify it by specifying %(ProjectReferenceWithConfiguration.Name), or ensure that all items in this list define a value for this metadata.

[12:22:45]

Two questions

Q1. If anyone had this problem before on team city please tell me how to solve it

Q2. If not, I am thinking of not letting team city build the sln instead make visual studio do it. Is there a way to invoke visual studio from the command line so it builds the azure cloud service sln.

abdullam
  • 225
  • 1
  • 3
  • 15
  • I figured it out. It was MSBuild building things out of order. This [article](http://blogs.msdn.com/b/visualstudio/archive/2010/12/21/incorrect-solution-build-ordering-when-using-msbuild-exe.aspx) described the problem and the solution real well. – abdullam Nov 01 '15 at 05:06

2 Answers2

4

I got the MSB4096 error and tried all sorts of things to make it go away. I thought it might be related to some recent changes to the solution as new project had been added. I reverted just the solution file and re-built it. The MSB4096 error went away, but I got some other project reference errors, which is to be expected. I then 'un-reverted' the solution file (i.e. got latest version), and re-built the solution. Everything built fine - no MSB4096 error. O_o

I guess this is the equivalent of switching it off and then on again. Maybe Visual Studio caches some data somewhere and changing the solution file forces it to re-build the cache. I have no idea, but it's worth try if you run into this problem...

TallGuy
  • 1,873
  • 6
  • 22
  • 35
-1

This helped me in Azure cloud service; an additional project was added to solution. There should be only web/worker roles in solution.

[...] I can tidy up by removing the dependency in the solution file as well – removing now-unnecessary lines like this — your GUID will be different, but use the VS dialog and it will do the job.

ProjectSection(ProjectDependencies) = postProject 
    {B79CE0B0-565B-4BC5-8D28-8463A05F0EDC} = {B79CE0B0-565B-4BC5-8D28-8463A05F0EDC}
EndProjectSection

Source: Answer to Question about Visual Studio *.sln file format, which itself quotes a Microsoft forum discussion.

TylerH
  • 20,799
  • 66
  • 75
  • 101
mititch
  • 1
  • 1