gdubs
gdubs

Reputation: 2754

mvc 4 app on a web server without mvc 4 installed

So I just upgraded my website to a MVC 4 site from MVC 3. My Web host does not have MVC 4 installed but was advised that I can just upload the dlls and all will be alright. I was directed to this link which apparently can be applied when installed

http://weblogs.asp.net/scottgu/archive/2011/01/18/running-an-asp-net-mvc-3-app-on-a-web-server-that-doesn-t-have-asp-net-mvc-3-installed.aspx

I did what is instructed on the following link but then I'm getting an error on my ViewExtensions which apparently (after a 2 hour research) is related to my upgrade (eg. http://s77.codeinspot.com/q/2109234) . Anyway this is the error being thrown.

filterContext.Exception.Message :\hostingpath............... error CS0121: The call is ambiguous between the following methods or properties: 'Torneyo.Infrastructure.Helpers.ViewExtensions.AccountProfile(System.Web.Mvc.ViewMasterPage)' and 'Torneyo.Infrastructure.Helpers.ViewExtensions.AccountProfile(System.Web.Mvc.ViewMasterPage)'

Which doesn't make sense as it's the same and it's just coming from my viewextension class. Following is the part which is being called on my masterpage.

//-----------for master pages
        static public User AccountProfile(this System.Web.Mvc.ViewMasterPage view)
        {
            return (Profile)view.ViewBag.AccountProfile;
        } 

So these were all working perfectly before the upgrade on the webhost. It runs perfectly on my local before and after the upgrade. I'm not really sure what else I need to do.

Upvotes: 2

Views: 342

Answers (2)

gdubs
gdubs

Reputation: 2754

Finally fixed it. So I tried wiping out the DLLs and reinstalled it but it still doesn't work. What I had to do was to remove everything (Files in the wwwroot folder). And then published it again. Everything worked fine after that.

Upvotes: 0

Eilon
Eilon

Reputation: 25704

Please make sure that you have the correct binding redirects in your web.config. Chances are that parts of the app are referencing MVC3 and other parts are referencing MVC4. A binding redirect from MVC3 to MVC4 will "unify" everything to MVC4.

Check out the "upgrade" guide here: http://www.asp.net/whitepapers/mvc4-release-notes#_Toc303253806

Upvotes: 2

Related Questions