none
ASP.NET MVC 4 build fails

    Question

  • I created a new team project in TFS Preview and a new ASP.NET MVC4 based Azure Web Role. The build server dies when building the website with the following errors:

    App_Start\BundleConfig.cs (2): The type or namespace name 'Optimization' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
    Global.asax.cs (5): The type or namespace name 'Infrastructure' does not exist in the namespace 'System.Data.Entity' (are you missing an assembly reference?)
    Global.asax.cs (10): The type or namespace name 'Optimization' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
    App_Start\BundleConfig.cs (8): The type or namespace name 'BundleCollection' could not be found (are you missing a using directive or an assembly reference?)

    Keep your head in the Clouds as you're coding .NET http://azurecoding.net

    Wednesday, June 20, 2012 4:23 AM

Answers

All replies

  • Is your project targeted to 4.5 framework or 4.0?
    Wednesday, June 20, 2012 3:38 PM
    Owner
  • It targets 4.0. If I deploy directly to Azure it runs without hitch.

    Keep your head in the Clouds as you're coding .NET http://azurecoding.net

    Wednesday, June 20, 2012 3:40 PM
  • It looks like you are missing the assemblies needed for building the project successfully on TFS Server. Could you try checking in the needed assemblies to TFS and kick off a build again?

    Thanks,

    Kirthi

    Wednesday, June 20, 2012 6:07 PM
    Moderator
  • So which assemblies should I check in? I know in VS2010 there was an option to automatically add the MVC assemblies to the project. I don't see the option in 2012. Does TFS 2012 not include the MVC4 assemblies built in?


    Keep your head in the Clouds as you're coding .NET http://azurecoding.net

    Wednesday, June 20, 2012 7:06 PM
  • I just looked in source control. All of the MVC dependencies are checked in under the nuget packages folder. But it looks like the MVC 4 template references the GAC instead.

    Keep your head in the Clouds as you're coding .NET http://azurecoding.net

    Wednesday, June 20, 2012 7:15 PM
  • Uninstalled and reinstalled the nuget packages fixed the reference for me.

    Keep your head in the Clouds as you're coding .NET http://azurecoding.net

    Wednesday, June 20, 2012 7:28 PM
  • That works locally, but my CI builds fail now.

    Shameless Plug: My wife and I have fun making indie games! Check us out at http://forbetterorforworseindiegames.blogspot.com/

    Wednesday, July 17, 2013 8:03 PM