Error building vs2008 solution using MVC

I've had success building vs2008 sln files in the past but now I'm attempting to build one that is using MVC.

I have installed the 3.5 framework on the build machine and installed the ASPNET MVC Preview 4 on the machine. I have installed the same on my local machine, the only difference that I can see is that my local machine has vs2008 installed while the build machine has no visual studio installed.

Is this necessary? If I build the solution through visual studio on my local or through the vs2008 command prompt, it succeeds. Once I try to have Team City build it, I receive these errors:

  1. BootStrapper.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?)

  2. Controllers\AuthenticateController.cs(4, 18): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

  3. Controllers\AuthenticateController.cs(15, 43): error CS0246: The type or namespace name 'Controller' could not be found (are you missing a using directive or an assembly reference?)

  4. Controllers\BeneficiariesController.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?)


Does anyone have any ideas?

3 comments

How do you reference MVC assemblies? (GAC or filesystem).
If you use GAC, please check build agent service user has enough rights for that.
Please check all necessary libraries are available on the build agent machine.

Please try running the same msbuild script from build agent's machine in the build working directory. Does that works?

Thanks!

0

They are referenced via file system. It turns out that there were some bad references in some of the .csproj files in the solution. There were extra directory jumps that didn't exist (..\..\)

For some reason, when compiling with Visual Studio (either IDE or command prompt) the references are able to be resolved, but when using plain msbuild from the command prompt it gives the error. The strange thing is, Visual Studio doesn't fix the bad references, it is just able to live with them, so the same project was building in the IDE and failing with msbuild. I fixed the references and everything works now.

0

Sorry for the long delay. The question is still relevant? If yes please leave a comment or create a separate thread.

Kind regards,
Marina
0

Please sign in to leave a comment.