Shy Agam
Shy Agam

Reputation: 1415

Installed nuget package depends on older version of System.Web.Mvc.dll after Publish

I have an MVC4 application developed with Visual Studio 2010. Project works fine on IIS Express. When publishing it to IIS8 and trying to access it I get an exception saying the System.Web.Mvc, Version=3.0.0.0 assembly could not be loaded. The calling assembly is AttributeRouting.Web.Mvc, which is a NuGet package I use.

The way I understand it, my project referes to version 4.0.0.0 of System.Web.Mvc, while the package I'm using depends on 3.0.0.0.

  1. If Visual Studio/IIS Express can run it perfectly, how come the published version has this problem?

  2. I read a lot only today, but still couldn't figure it out. Is this what Binding Redirect used for?

I'm kind'a lost here, feeling like I don't really have any direction. Any advice is welcomed.

Thanks in advance, Shy.

Upvotes: 2

Views: 710

Answers (1)

Shy Agam
Shy Agam

Reputation: 1415

SOLVED:
I simply (Well it wasn't so simple) installed MVC3 in addition to versions 2 and 4.
Problem disappeared without the need of any further changes.

Solution: Download and install MVC3 from Microsoft's website.
In case installation failes:

  1. Extract the setup file.
  2. Open ParameterInfo.Xml in an editor.
  3. Remove completely the <Exe> tag that refers to the vs10-kb2483190 file.
  4. Run setup again.

Thank you very much for your help @Augusto.

Hope this helps someone someday :)

Upvotes: 1

Related Questions