I'm trying to setup a build for a .Net MVC project in TeamCity. I followed the steps described here: How to build ASPNET applications in TeamCity
But the build is still failing. The error messages I have are
App_Start\BundleConfig.cs(2, 18): error CS0234: The type or namespace name 'Optimization' does
not exist in the namespace 'System.Web' (are you missing an assembly reference?)
App_Start\FilterConfig.cs(2, 18): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
App_Start\RouteConfig.cs(5, 18): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
Controllers\HomeController.cs(5, 18): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
Controllers\HomeController.cs(9, 35): error CS0246: The type or namespace name 'Controller' could not be found (are you missing a using directive or an assembly reference?)
Global.asax.cs(5, 18): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
Global.asax.cs(6, 18): error CS0234: The type or namespace name 'Optimization' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
App_Start\BundleConfig.cs(9, 44): error CS0246: The type or namespace name 'BundleCollection' could not be found (are you missing a using directive or an assembly reference?)
App_Start\FilterConfig.cs(8, 50): error CS0246: The type or namespace name 'GlobalFilterCollection' could not be found (are you missing a using directive or an assembly reference?)
Controllers\HomeController.cs(11, 16): error CS0246: The type or namespace name 'ActionResult' could not be found (are you missing a using directive or an assembly reference?)
Controllers\HomeController.cs(16, 16): error CS0246: The type or namespace name 'ActionResult' could not be found (are you missing a using directive or an assembly reference?)
Controllers\HomeController.cs(23, 16): error CS0246: The type or namespace name 'ActionResult' could not be found (are you missing a using directive or an assembly reference?)
I have all the references with Copy Local = true and True in the csproj. TeamCity is downloading correctly the nuget packages but it seems that is not using them. All I can see is that in the .csprojResolveAssemblyReference file in obj/Release there is the following line:
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.1\System.Web.dll
So, it seems that is using that file and not the file in the nuget folder.
What do I have to do to have the build up and running?
Thank you very much.