Andy
Andy

Reputation: 105

mvc application deployment not working

I'm trying to deploy an mvc application to a server (under my control), but it's doing my head in. The only info I seem to find online is about mvc1->2 upgrades, i'm on .net 4.

Here's the error I'm getting:

Method not found: 'System.Object System.Web.Mvc.ControllerBase.get_ViewBag()'.

I ran the mvc diagnostics utility aspx page, output below. Any ideas? Thanks everyone...

Errors were found. Please see below for more information.

Environment Information


Operating system: Microsoft Windows NT 6.1.7601 Service Pack 1
.NET Framework version: 4.0.30319.17929 (64-bit)
Web server: Microsoft-IIS/7.5
Integrated pipeline: True
Worker process: w3wp.exe 

ASP.NET MVC Assembly Information (System.Web.Mvc.dll)


Multiple ASP.NET MVC assemblies have been loaded into this application.

Assembly version: Unknown version (3.0.11029.0)
Full name: System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Code base: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Web.Mvc/v4.0_3.0.0.0__31bf3856ad364e35/System.Web.Mvc.dll
Deployment: GAC-deployed 

Assembly version: Unknown version (4.0.20710.0)
Full name: System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Code base: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Web.Mvc/v4.0_4.0.0.0__31bf3856ad364e35/System.Web.Mvc.dll
Deployment: GAC-deployed 

ASP.NET MVC Futures Assembly Information (Microsoft.Web.Mvc.dll)


An ASP.NET MVC Futures assembly has not been loaded into this application. 

All Loaded Assemblies


74 assemblies are loaded.
•A_e821af9e_9cb7_4a6b_bbb0_ecd9d1e31323, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
•Anonymously Hosted DynamicMethods Assembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
•App_global.asax, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
•App_Web_gcumpw0y, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
•EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•HttpToHttpsRedir, Version=6.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•Microsoft.JScript, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•Microsoft.Transactions.Bridge, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•Microsoft.VisualBasic.Activities.Compiler, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•MvcPaging, Version=1.0.2.0, Culture=neutral, PublicKeyToken=null
•PinLookup, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
•SMDiagnostics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Data.Services.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Data.SqlXml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.DirectoryServices.Protocols, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Messaging, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.Numerics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Runtime.Caching, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.Runtime.DurableInstancing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.ServiceModel.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.ServiceModel.Internals, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.ServiceModel.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Transactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.Mobile, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.RegularExpressions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
•System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.WebPages.Deployment, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Workflow.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Workflow.ComponentModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Workflow.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.WorkflowServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Xaml.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
•System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
•System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Diagnostics version: 02/16/2010 00:00:00 v7
Report generated on: 06/19/2013 22:11:40 

Upvotes: 1

Views: 1070

Answers (2)

Andy
Andy

Reputation: 105

Thanks for all comments.

In the end it turned out that there was version mismatches of the mvc assemblies in the gac, for some reason they must not have installed properly, even though there was no errors displayed during the installation.

I did try to deploy the required assemblies with my application, but the gac assemblies override local assemblies, even though the deployed assemblies are newer.

After a complete uninstall and reinstall of mvc3, mvc4, .net4.5 and .net4 (and the reboots that .net4.5 requires - very annoying!) it finally worked fine. It's the 4th server I have deployed this particular application to - in each case there were no previous mvc applications so I installed the runtimes - and the first one to cause a headache like that.

Anyway, hope it helps someone else down the track.

Upvotes: 0

dave clements
dave clements

Reputation: 1505

It looks like you're missing the reference to Microsoft.Web.Mvc.

ASP.NET MVC Futures Assembly Information (Microsoft.Web.Mvc.dll)

An ASP.NET MVC Futures assembly has not been loaded into this application. 

Try setting the dll to copy local in the project settings and then republish

Upvotes: 1

Related Questions