Tag Archives: IIS

On production machine: AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts.

I was helping my colleagues to debug one weird bug on ASP.NET 4.0 website. Everything worked well on developer’s machine, but after publishing to IIS 7.5 Windows 2008 R2 Webserver, we always got site partially working. Everything worked, except AJAX Control Toolkit controls.

There were no any signs of errors. Ajax controls just were not functioning. Digging deeper, we found, that JavaScript is throwing exceptions:
SCRIPT5022: AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts. Ensure the correct version of the scripts are referenced. If you are using an ASP.NET ScriptManager, switch to the ToolkitScriptManager in AjaxControlToolkit.dll.

This is the most common error with AJAX Control Toolkit — you need to use ToolkitScriptManager instead of ScriptManager. Read more here.

But in our case we was already using ToolkitScriptManager in the all places in our source code.

Digging deeper we found that there is a bug in Script Manager, that is trying to load all DLLs in the project’s bin folder. Script Manager is trying to load DLL files even if they are not used in the project. [I know, that it is not best practice, to keep files not used by project on the production server, but that's another story.]

The solution was plain and simple: remove all unused DLLs from production machine’s bin folder.

More info about bug and the same problem in different product:

ASP.NET 4.0 – An error occurred during local report processing

After fixing missing ReportViewer redistributable, I got the following error:
Report Viewer Configuration Error The Report Viewer Web Control HTTP Handler has not been registered in the application's web.config file. Add to the system.web/httpHandlers section of the web.config file, or add to the system.webServer/handlers section for Internet Information Services 7 or later.




Loading...


An error occurred during local report processing.
The report definition for report 'C:\inetpub\wwwroot\some_path_to_report\tse.rdlc' has not been specified
Could not find file 'C:\inetpub\wwwroot\some_path_to_report\tse.rdlc'.

It turned out that Visual Studio 2010 C# / ASP.NET does not include .rdlc files when publishing application. This can be solved by going to the your_file.rdlc properties, and changing ‘Build Action’ from ‘Embedded Resource’ to ‘Content’.

Here is a screen-shot:

.rdlc Report File Properties

IIS 7.5 – Parser Error Message: Could not load file or assembly Microsoft.ReportViewer.WebForms

When deploying a new application to IIS 7.5 on Windows Server 2008 R2 (test server). I got the following error:
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.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.


Source Error:


Line 24: <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Line 25: <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
Line 26: <add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
Line 27: <add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
Line 28: <add assembly="Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />


Source File: C:\inetpub\wwwroot\web.config Line: 26


Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.ReportViewer.WebForms, Version=10.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.1

Parser Error Message: Could not load file or assembly 'Microsoft.ReportViewer.WebForms...

I forgot to install Microsoft ReportViewer 2010 Redistributable.

It also can be installed from the following location:
C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\ReportViewer\ReportViewer.exe

Microsoft Report Viewer 2010 Redistributable Package Setup is easy 3 step process:

Microsoft Report Viewer 2010 Redistributable Package Setup
Microsoft Report Viewer 2010 Redistributable Package Setup 2
Microsoft Report Viewer 2010 Redistributable Package Setup Finished