Kesiya Abraham
Kesiya Abraham

Reputation: 853

Same build showing different behaviour in different servers in IIS

I have deployed an application on two different servers.I have taken build using Visual studio 2012.Both servers are using IIS (version 7.5).The operating system used is Windows 2008 R2.The application pool .net framework is 4 .But the build deployed in one server working fine.But the build in other server showing error in web.config itself.The error is regarding the version of assembly referenced.For example:

Assembly 'System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' uses 'System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

Anyone, please help me to find out why this error is showing on one server only and why it is working fine on another server.

Upvotes: 0

Views: 514

Answers (1)

Treziac
Treziac

Reputation: 3264

It's because your two servers don't have the same version of ASP.NET MVC installed (given the version used, I assume you created an asp.net MVC4 project in VS2012, that ASP.NET MVC4 is installed on the first server, and MVC3 only on the second.

  • Either install MVC4 on the second server (standalone installation from https://learn.microsoft.com/en-us/aspnet/mvc/mvc4)
  • Either deploy the necessary aspnet dll aside with your dlls, by setting copyLocal to true (see here: MVC4 minimum references)
  • Or, better, add an nuget referene to Microsoft.AspNet.Mvc in your project (Install-Package Microsoft.AspNet.Mvc -Version 4.0.40804), so deployment include all necessaries dll automatically

Also, you might need some binding redirection in your web.config, but I don't think it's the case here

Upvotes: 1

Related Questions