Could not load file or assembly 'Microsoft.ReportViewer.WebForms

I have created a web application which uses the Reportviewer contol.

It runs fine on my development pc but I get the error shown below when I attempt to run it on our server.

I have tried installing the ReportViewer redistributanle directly on the server but this didnt work.

I then tried creating a web setup project and attempted to install that directly onto the server but I get an error 'An errour has occurred while attempting to create the directory Web Folder'. I am logged in as administrator.

Can anyone help?

Hawkmoth

Server Error in '/AspWeb/test' Application.


Parser Error

Description:An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

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

Source Error:

Line 1: <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> Line 2:Line 3: <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"Line 4: Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %> Line 5:

Source File:/aspweb/test/default.aspx Line:3

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.ReportViewer.WebForms, Version=8.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:2.0.50727.42; ASP.NET Version:2.0.50727.42
[2944 byte] By [Hawkmoth] at [2008-2-12]
# 1

In case you haven't found this yet...

http://msdn2.microsoft.com/en-us/library/ms251723.aspx

should fix the issue.

causal at 2007-9-10 > top of Msdn Tech,Feedback for forums and MSDN websites,Off-Topic Posts (Do Not Post Here)...
# 2

I managed to get over this issue in the end.

I can't remeber exactly how. I think I had to install the report viewer redistributle.

Then republish the web application and reboot the server (or the other way arround).

Seemed ok after that.

I ran into the same problem again on another server when I move several of the web apps over. But this time I realised what the problem was and installed the redistributable.

Thanks for your help. I had fogotten i had this open still!!

Hawkmoth at 2007-9-10 > top of Msdn Tech,Feedback for forums and MSDN websites,Off-Topic Posts (Do Not Post Here)...
# 3

Hi there!

I am running into same problem.

Error message: Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

I looked into the

http://msdn2.microsoft.com/en-us/library/ms251723.aspx guided by you. this is what i did.

I copied Reportviewer.exe file from my local machine located at <Drive>:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\ReportViewer\ReportViewer.exe and paste that exe file into webserver.

Then I execute that exe file on ther server. but still it is throwing the same error. i dont have visual studio install in web server, i think i even dont need to have visual studio installed on server.

is really required to reboot the server once I install the reportviewer.exe? I didnt reboot my server yet. as so many applications are running on server which I dont want to interrupt.

is there any thing i m doing wrong?

Please help..

Thanks in advance.

BhaveshPatel at 2007-9-10 > top of Msdn Tech,Feedback for forums and MSDN websites,Off-Topic Posts (Do Not Post Here)...
# 4

Hi BhaveshPatel

This crystal reports seems to cause all sorts of problems for people. I have had several issues with it but I think I may be able to help you.

You may want to try this first. I posted the same question here and eventualy figured out what the problem was for me.

http://forums.asp.net/p/972710/1228324.aspx#1228324

In my case it was because I copied the website from my developement pc to my server. 'Website > Copy Website' on the VS2005 menu

I should have 'Published' my web application instead. 'Build > Publish Website' on the VS2005 menu

This creates the bin director and places the required viewer dlls into you web app on the server, amongst other things.

Further on:-

The other problem you may get is with the common and runtime crystal report dll’s that need to be loaded onto your server for things to work correctly.

There are a number of ways to achieve this and it can also depend on which version of VS you are using or if have a stand alone copy of Crystal reports.

I was using a stand alone copy of crystal reports 10 and I downloaded this from redistributable CrystalReports10_NET_EmbeddedInstall.msi from the BusinessObjects website. (this didn't reboot my server)

http://support.businessobjects.com/communityCS/FilesAndUpdates/cr10_net_server_install.zip.asp

This document covers some installation scenarios for this.

http://support.businessobjects.com/communitycs/technicalpapers/deploying_cr10_net.pdf

If you are using just VS2003 then you can ether use merge modules and create a setup project and ‘install’ your web application onto your server.

Or you can install the ‘cr9netredist’ onto your server and then ‘Publish’ your web application

This document may help you with this:-

http://support.businessobjects.com/communityCS/TechnicalPapers/crnet_deployment.pdf

I am now using VS2005.

All you need to do is download the one of the following depending on your server architecture.

(x86 32bit)

http://support.businessobjects.com/communityCS/FilesAndUpdates/cr_net_2005_mergemodules_mlb_x86.zip.asp

(IA 64bit)

http://support.businessobjects.com/communityCS/FilesAndUpdates/cr_net_2005_mergemodules_mlb_ia64.zip.asp

(x64 64bit)

http://support.businessobjects.com/communityCS/FilesAndUpdates/cr_net_2005_mergemodules_mlb_x64.zip.asp

Install this onto your server. It creates a website but also installs the files required. (On my server this didn’t require a server reboot)

The ‘publish’ you web application as normal.

Most of the modules and MSI packages and some documentation can be found here for all the different varions that you may have http://support.businessobjects.com/downloads/merge_modules.asp

Hope this is some help and good luck!

Hawkmoth

Hawkmoth at 2007-9-10 > top of Msdn Tech,Feedback for forums and MSDN websites,Off-Topic Posts (Do Not Post Here)...
# 5

thanks Hawkmoth

I had the same problem as you do. i can not publish the website using visual studio as the application was being deployed in totally different network. Well thanks for your time and reply again, but during this period i did something like this and it worked for me.

(1) copied reportviewer.exe from my local machine and paste it on the server. Execute the reportviewer.exe.

(2) then simply copy three dll files from local machine and kept it on bin folder of application on server.

Microsoft.ReportViewer.Common.dll

Microsoft.ReportViewer.WebForms.dll

Microsoft.ReportViewer.WinForms.dll

which i found on my local machine at C:\Program Files\Microsoft Visual Studio 8\ReportViewer .

Hope fully this helps to others too..

regards

Bhavesh Patel

BhaveshPatel at 2007-9-10 > top of Msdn Tech,Feedback for forums and MSDN websites,Off-Topic Posts (Do Not Post Here)...