ReportViewer, Scriptmanager and .NET 4.0 Crash


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=, 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:

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

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.
asked on Stack Overflow Jul 24, 2013 by Michael Cook • edited Jul 24, 2013 by Michael Cook

1 Answer


Turns out this is an issue with the .NET 4.0 framework. There is a KB to fix this issue:

answered on Stack Overflow Jul 24, 2013 by Michael Cook

User contributions licensed under CC BY-SA 3.0