Answered ASP.NET MVC 4 build fails

  • Wednesday, June 20, 2012 4:23 AM
     
      Has Code

    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

All Replies

  • Wednesday, June 20, 2012 3:38 PM
    Owner
     
     
    Is your project targeted to 4.5 framework or 4.0?
  • Wednesday, June 20, 2012 3:40 PM
     
     
    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 6:07 PM
    Moderator
     
     

    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 7:06 PM
     
     

    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:15 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:28 PM
     
     Answered
    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