views:

21

answers:

1

I have a simple .NET 4.0 web forms app that references the Microsoft.ReportViewer namespace:

<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>

with a simple ReportViewer control on a page:

<rsweb:ReportViewer runat="server" ProcessingMode="Remote"></rsweb:ReportViewer>

The project references the dll in C:\Program Files......\Microsoft.ReportViewer.dll. The project is currently set to not copy the .dll to bin on Compile.

During deployment, should I change the build action to Copy=true, and copy all the .dll files from the bin directory or should I copy the ReportViewer dll from it's original location? Also, will I need to run some installation on the server (Windows Server 2008, IIS7)?

It appears to be working by just copying over the dll (from either location). But, I'm not sure what the normal deploy method is.

+2  A: 

There are a couple options.

  1. You can do as you said, and set the Copy Local to true. This will copy the DLL in your bin folder.
  2. You can register the DLL in your Global Assembly Cache (GAC). This required that you have access to the server.

To me the choice comes down to control of server and how many projects will use that DLL on your server.

Dustin Laine
It also seems to need ReportViewer.Common. Should I run some install on the server instead of GACing or copying dlls?
Phil Scholtes
Not sure, you could just do the same with the DLL also. I know with MVC I have to do that with 3 DLL's on some shared hosting.
Dustin Laine
I'm just going to GAC the libraries and leave CopyLocal=false. I'll post back if I have issues. Thanks for the help.
Phil Scholtes
Instead of manually GACing the libraries, I just ran the installer on the server which GAC'd them all for me. This is the best solution. Link: http://msdn.microsoft.com/en-us/library/ms251723.aspx
Phil Scholtes