0
votes

I'm having some issues to get routing to work on a box where I develop MVC2 based web applications. I tested the site with MvcDiagnostics.aspx and found the following

ASP.NET MVC Assembly Information (System.Web.Mvc.dll)

Multiple ASP.NET MVC assemblies have been loaded into this application.

Assembly version: ASP.NET MVC 2 RTM (2.0.50217.0) Full name: System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 Code base: file:///C:/Windows/assembly/GAC_MSIL/System.Web.Mvc/2.0.0.0__31bf3856ad364e35/System.Web.Mvc.dll Deployment: GAC-deployed

Assembly version: Unknown version (3.0.20105.0) Full name: System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 Code base: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Web.Mvc/v4.0_3.0.0.0__31bf3856ad364e35/System.Web.Mvc.dll Deployment: GAC-deployed

I think I have looked everywhere for references. The reference in the project is only pointing to the 2.0.0.0 version. Also the web.config seems alright

<system.web>
    <compilation debug="true" batch="false" defaultLanguage="c#" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </assemblies>
    </compilation>
</system.web>

Any advice where to look?

2

2 Answers

1
votes

Did a bit more tracing and found that Elmah caused this

Could not load type 'System.Web.Mvc.GlobalFilters' from assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

Removing any references to elmah resolved the issue

0
votes

Check the reference to System.Web.Mvc.dll file in your reference. Make sure its pointing to C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll

If its pointing to the one under ASP.NET MVC 4 directory then open your project file in a notepad. Look for

<Reference Include="System.Web.Mvc">
  <Private>False</Private>
</Reference>

This should be changed to

<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35, processorArchitecture=MSIL" />