locked
Could not load file or assembly 'Microsoft.ReportViewer.Common,... The system cannot find the file specified. RRS feed

  • Question

  • I created a new ASP.NET Reports Web Site, attached some data from a database to the created Report Viewer, created a profile to publish this web app using Azure and I keep running into this error when I publish it online:

    Server Error in '/' Application.

    Configuration Error

    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

    Parser Error Message: Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.

    Source Error: 
    An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

    Source File: Line: 21 

    Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.ReportViewer.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' could not be loaded.
    WRN: Assembly binding logging is turned OFF.
    To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
    Note: There is some performance penalty associated with assembly bind failure logging.
    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
    


    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.36283

    However I ran it locally, and it runs flawlessley.

    I've narrowed it down to that it's an issue with the ReportViewer dll's. I've attempted it with various ASP projects and still end up with the same result. And yes, I've made sure that it the dll files were loaded into the bin folder on the server for the project... Any help with this issue??

    Gerneio

    Thursday, June 25, 2015 12:17 AM

Answers

  • The Microsoft.ReportViewer.Common.dll in your zip is 10.0, while your web.config is trying to load 11.0. Since you don't have a binding redirect, this fails. So from a runtime point of view, this is by design.

    Try including 11.0 in your bin instead.

    • Proposed as answer by David Ebbo Tuesday, June 30, 2015 5:47 PM
    • Marked as answer by Gerneio Wednesday, July 1, 2015 3:22 PM
    Tuesday, June 30, 2015 5:47 PM

All replies

  • Hello Gerneio,

    The error message indicates that some of the assemblies are missing that you need to include. Please refer to the thread below and include the assemblies as indicated by Jim Cheshire:
    https://social.msdn.microsoft.com/Forums/azure/en-US/1815da88-c20c-4523-b304-38e9946ec981/microsoft-report-viewer-doesnt-work-on-azure-website-why?forum=windowsazurewebsitespreview

    Thanks,
    Syed Irfan Hussain

    • Proposed as answer by Syed Irfan Hussain Thursday, June 25, 2015 7:17 AM
    • Unproposed as answer by Gerneio Monday, June 29, 2015 6:15 PM
    Thursday, June 25, 2015 7:16 AM
  • I can't find the place to check the 'GAC' type part, however I have verified that the CopyLocal property is set to true and, consequently, the DLL's have been uploaded to the /BIN folder of the  deployed web app. Still no luck...

    Gerneio

    Thursday, June 25, 2015 5:06 PM
  • You can use Kudu Console to make sure that the relevant DLL's indeed made it into your site\wwwroot\bin folder.

    Note that the error could conceivably related not to Microsoft.ReportViewer.Common itself, but to other assembly that it depends on.

    Thursday, June 25, 2015 5:24 PM
  • You can use Kudu Console to make sure that the relevant DLL's indeed made it into your site\wwwroot\bin folder.

    Note that the error could conceivably related not to Microsoft.ReportViewer.Common itself, but to other assembly that it depends on.

    Thank you for the Kudu tip! I was aware of it, but hadn't done enough digging to find some of it's relevant uses in this cases. I verified that the correct DLL's are loaded into the BIN folder.

    However, I created an ASP.net Reports Web Site to test this issue with a different project, which automatically creates a Report Viewer control to it, therefore requiring the above DLL's. This website is having the same issue as my first one. Works when run locally, comes up with the same error when run remotely. I can verify in Visual Studio under Debug > Project Properties > References that the DLL's have been added to this project, however 1. They are labeled as 'GAC' and 2. they are the only ones listed under References. There is no References Section under the Solution Explorer, therefore I can't seem to change the CopyLocal option. However I can right click the project name and add a reference from there. I used Kudo to try to see what was in the BIN folder, however I could not find the BIN folder anywhere. 

    Issue on top of issues :(

    Gerneio

    Friday, June 26, 2015 4:35 PM
  • Any chance you can share a test repo? This way we can try the exact same thing as you on a test site.

    thanks,
    David

    Friday, June 26, 2015 5:45 PM
  • Didn't have time to fiddle around with the test repo stuff. However here is a link that you can download the project and the publish settings. 

    http://1drv.ms/1NooQB2

    This is pretty much a fresh project that I only did two things to it:

    1. Web.config, Line 22, Added for remote debugging

    2. Default.aspx, Line 21-23, Added ReportViewer Control

    This one has had the same issues that all of my other attempted projects have had when using the ReportViewer Control.

    Gerneio


    • Edited by Gerneio Sunday, June 28, 2015 9:06 PM
    Sunday, June 28, 2015 9:03 PM
  • The Microsoft.ReportViewer.Common.dll in your zip is 10.0, while your web.config is trying to load 11.0. Since you don't have a binding redirect, this fails. So from a runtime point of view, this is by design.

    Try including 11.0 in your bin instead.

    • Proposed as answer by David Ebbo Tuesday, June 30, 2015 5:47 PM
    • Marked as answer by Gerneio Wednesday, July 1, 2015 3:22 PM
    Tuesday, June 30, 2015 5:47 PM
  • The Microsoft.ReportViewer.Common.dll in your zip is 10.0, while your web.config is trying to load 11.0. Since you don't have a binding redirect, this fails. So from a runtime point of view, this is by design.

    Try including 11.0 in your bin instead.

    I feel like banging my head against a wall now! I saw that issue early on, but I disregarded it since it was running locally. Oddly, my machine had the 10.0 and 12.0 versions, missing the 11.0. So I downloaded the Microsoft Report Viewer 2012 Runtime, and installed it. I had to manually point to the new 11.0 DLL in references, however I tested it out and seems to be loading correctly now! Thank you so much for bringing my attention back to that issue.

    Gerneio

    Wednesday, July 1, 2015 3:16 PM
  • He never mentioned a zip file.  He's publishing to Azure.
    Sunday, May 29, 2016 10:09 AM