I am trying to get the build working on the build agent in TFS. I can successfully build the solution in Visual studio 2012 RC and other developers can do the same in theirs. I created the build definition for the debug configuration and queued the build in TFS server. I get the following error logs.
Error: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1046): The command "IF EXIST ../batch (
cd ../batch
) ELSE (
cd ../../Sources/Solution_Name/Project_Name/batch
)
createDepsFile Project_Name
" exited with code 9009.
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1561): Could not resolve this reference. Could not locate the assembly "System.Web.Optimization". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1561): Could not resolve this reference. Could not locate the assembly "System.Web.Providers". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
Error Global.asax.cs (16): The type or namespace name 'Optimization' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
I checked the reference added to the projects. I cannot find those assemblies. After looking all over the posts, I found good suggestions like adding those assemblies to the solution using NuGet and then check in the solution in TFS. Missing reference are only “warnings” not error.I still cannot find all the assemblies in the Nuget I am looking for. Some posts referred that the project might be referring to .Net 4.5 instead of .Net 4.0 as installed in the build machine. I do not want to change the solution until I know exactly the problem is. I am scattered on this problem.
At this point I do not think it has something to do with the Build Definition. And Code 9009 is not helping either. I may be wrong. Any suggestions guys need help on this one.
Thanks for the response guys. I found the problem. Some of the .dll were not on the right path. I just moved the .dll to one of the place where MSbuild was looking for.