alexbeletsky / elmah-mvc

Painless integration of ELMAH into ASP.NET MVC application
http://nuget.org/packages/Elmah.MVC
Apache License 2.0
266 stars 61 forks source link

MVC 3 and Elmah.MVC 2.1.2, different versions of System.Web.WebPages #70

Closed mdonio closed 9 years ago

mdonio commented 9 years ago

I recently installed the Elmah.MVC nuget package, version 2.1.2 on my existing MVC 3 project. Locally, it runs fine. Once I uploaded to the site, navigating to my elmah route generates the following error:

Could not load file or assembly 'System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

It appears Elmah wants System.Web.Webpages Version 2, but MVC 3 uses Version 1. Is it possible to use both versions?

alexbeletsky commented 9 years ago

@issafram have you seen anything like that, man?

issafram commented 9 years ago

You might need an assemblyBinding in your web.config. You said it works locally so I'm not sure how your server is different.

mdonio commented 9 years ago

Hi, I've added an assemblyBinding and then referenced version 2.0, but it breaks the rest of the site. Looks like I need to keep version 1.0. Does elmah reference version 2.0?

mdonio commented 9 years ago

I solved the issue by updating to mvc 4, which uses version 2 of the System.Web.Webpages. After further review, I believe an error in my configuration caused this issue. Thanks!