Full Error Message:
Could not load file or assembly ‘Microsoft.ReportViewer.Common, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91’ or one of its dependencies. The system cannot find the file specified.
Seeing this issue on Windows 10 Anniversary, currently, and I suspect it is a GAC registration issue.
You don’t normally have to reference ReportViewer.Common to projects anymore, although I suppose you could manually do this as first option. I recommend against this, since you need to repair the GAC registration, which is the underlying problem.
Symptom
Project builds and runs without any error, even with the registered assembly in your project is ReportViewer.WebForms (2015 / v12) then afterwards gives you the above build error about not finding ReportViewer.Commons
Best Resolution
Resolution is a manual install/reinstall of Microsoft Report Viewer 2015 runtime redistributable package from Microsoft.
Download
Should resolve the intermittent build error without having to change your project.
Third Option:
- Alternatively you could drop your ReportViewer reference in your project.
- Save project.
- Close Project.
- Close Visual Studio 2015.
- Update Visual Studio 2015 to Update 3, or if on Update 3, modify the install so you do a repair.
- Open latest version of VStudio 2015.
- Open Project.
- Re-Add Reference to ReportViewer.WebForms.
- Save Project.
- Close Project.
- Close Visual Studio 2015.
- Re-open Visual Studio 2015.
- Open project a 3rd time and it should be working.