Search code examples
tfsmsbuildasp.net-mvc-4mvc-mini-profiler

How to get MVC4 Project with MiniProfiler to build in TFS 2010?


I have an ASP.NET MVC4 project which builds in TFS. Since adding the MiniProfiler to the project, the builds fail as follows:

CA0001 : The following error was encountered while reading module 'MiniProfiler': 
Assembly reference cannot be resolved: System.Web.Mvc, Version=3.0.0.0, 
Culture=neutral, PublicKeyToken=31bf3856ad364e35.

CA0058 : The referenced assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' could not be found. This assembly is required for 
analysis and was referenced by: D:\Builds\...\my.dll, 
D:\...\packages\MiniProfiler.2.0.2\lib\net40\MiniProfiler.dll.

DotPeek shows me that MiniProfiler does indeed reference System.Web.Mvc Version 3.0.0.0

Has anyone run into this issue? Is there a solution?

I would install MVC3 on the build server, however I don't have admin permission to do it. Someone can do it for me next week but if possible I'd like to avoid that.


Solution

  • The cause of this was actually Code Analysis. We had analysis set to run on build, and the build server was not able to load the needed assemblies during analysis for some reason. I am still not sure of the root cause, but turning off code analysis solved the problem.