2

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.

Shy Agam
  • 1,285
  • 1
  • 13
  • 37
  • Does VIsual Studio show any warning in the error list after building the solution? I have VS 13 and it shows me a warning when there are assembly version conflicts. Double-clicking the warning fixes the issue (adds the necessary binding redirects to the config file) – Augusto Barreto Feb 13 '15 at 21:40
  • Yes, got the warning and clicked it already. Unfortunately it didn't do the job. – Shy Agam Feb 16 '15 at 12:47
  • Can you check this: http://stackoverflow.com/a/16855426/1454888 – Augusto Barreto Feb 16 '15 at 13:39
  • My doesn't have a xmlns property. However, when entering the Add Reference window of VS, I see that only System.Web.Mvc 2.0.0.0 and 4.0.0.1 are installed. Does that have anything to do with it? – Shy Agam Feb 16 '15 at 14:28
  • I don't know. Here is a post that talks about it: http://stackoverflow.com/questions/26406877/asp-net-mvc-security-patch-to-version-3-0-0-1-breaks-build – Augusto Barreto Feb 16 '15 at 14:42

1 Answers1

1

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 :)

Shy Agam
  • 1,285
  • 1
  • 13
  • 37