0

After upgrading NuGet from version 1 to version 2, installing a 3rd party code library and writing a small bit of code with this library, my ASP.NET application worked on my local development environment. But when I deployed it to the development server like I usually do, it gave me the below error. It seems that my assembly files were shifted around as there are many more in the bin folder than before (the old assembly files and the new third party files). There are a lot of questions regarding this configuration error, but I couldn't find one that helped my specific problem.

Server Error in '/tr' 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.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

Source Error:

Line 51:     <compilation debug="true" targetFramework="4.0">
Line 52:       <assemblies>
Line 53:         <add assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
Line 54:         <add assembly="Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
Line 55:         <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

Source File: G:\inetpub\trapcount\tr\web.config Line: 53

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 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.18067

WestAce
  • 860
  • 3
  • 9
  • 23
  • whats on line 53 of your config file? – Keith Nicholas Jul 22 '14 at 23:51
  • it seems that you haven't deployed Microsoft.ReportViewer.WebForms on the server. Make sure it is copied on the server – Ehsan Jul 22 '14 at 23:52
  • also what happens if you turn on assembly binding, seems to me the error message has given you a bunch of things to follow up on, have you tried to look at any of the things it suggests? – Keith Nicholas Jul 22 '14 at 23:52
  • when you compile it, what version of reportviewer do you have? is your config file binding to the wrong version? – Keith Nicholas Jul 22 '14 at 23:54
  • Microsoft.ReportViewer.WebForms.dll and Microsoft.ReportViewer.Webforms (xml) are both in the Assemblies folder of my project. – WestAce Jul 23 '14 at 00:03
  • Turning on assembly binding logging affects the registry which (if done wrong) can render the machine useless. Was hoping to avoid that option. – WestAce Jul 23 '14 at 00:05
  • @WestAce correct version is there? – Ehsan Jul 23 '14 at 00:06
  • ReportViewer version and config reference version are both 9 – WestAce Jul 23 '14 at 00:06
  • @Ehsan dll version? How would you check that? – WestAce Jul 23 '14 at 00:09
  • @WestAce you have said that report viewer is in the assemblies folder. try copying that on the root of your deployment. And you can check the dll version by doing a mouse over or viewing the properties – Ehsan Jul 23 '14 at 00:11
  • @Ehsan I see that my dll version is 9.0.30729.4402 and my web.config references 9.0.0.0. Is this the issue? – WestAce Jul 23 '14 at 00:19
  • @Ehsan also, I tried copying report viewer to the root of the deployment with no success. – WestAce Jul 23 '14 at 00:20
  • @Ehsan version is not the issue. The settings in my local environment match the settings in the development environment. – WestAce Jul 23 '14 at 16:35
  • Turns out the assembly file needed to be moved to the bin folder. I thought I had tried this, but apparently not. – WestAce Jul 23 '14 at 16:48

2 Answers2

0

Microsoft.ReportViewer.WebForms.dll is in the Assemblies folder in the root of the deployment. It needs to be moved to the bin folder with the rest of the assembly files.

WestAce
  • 860
  • 3
  • 9
  • 23
0

Install below files to avoid the error.

  • ReportViewer.exe
  • ReportViewer.msi
  • vcredist_x64.exe
Davis Broda
  • 4,102
  • 5
  • 23
  • 37