ReportViewer, Scriptmanager and .NET 4.0 Crash

0

I have a weird one. I'm working with an ASP.NET 4.0, mostly MVC 4, but with one Webforms page that holds a report viewer. It works fine on my local machine, however I get a strange behavior on the staging server.

On the first load it crashes with:

Could not load file or assembly 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047) 

However, the second time it works (at least for a while). I did set up a BindingRedirect:

  <dependentAssembly>
    <assemblyIdentity name="System.Core" publicKeyToken="7cec85d7bea7798e" />
    <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
  </dependentAssembly>

but again, it only works after crashing first. Also, it appears to be crashing at the required ScriptManager tag, but I don't know if that's a red herring or not since I'm pretty sure it's the ReportViewer that's referencing .NET 2.

asp.net
.net
asp.net-mvc
report-viewer2010
asked on Stack Overflow Jul 24, 2013 by Michael Cook • edited Jul 24, 2013 by Michael Cook

1 Answer

0

Turns out this is an issue with the .NET 4.0 framework. There is a KB to fix this issue: http://support.microsoft.com/kb/2468871

answered on Stack Overflow Jul 24, 2013 by Michael Cook

User contributions licensed under CC BY-SA 3.0