Question

I am working in an MVC3 application that references assemblies that use version 5 of the Microsoft Enterprise Library.

I am doing a research project about using the ReportViewer to create reports. I learned the ReportViewer can't be used in a Razor view, so I have to use a ASPX page. The page is below:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="Test.BirthdayReport.BirthdayReport" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Birthday Report</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
            <rsweb:ReportViewer ID="ReportViewer1" runat="server" Width="100%">                        </rsweb:ReportViewer>
        </div>
        </form>
    </body>
</html>

In order to use the ReportViewer, I have to include the ScriptManager, but when the page loads I receive this error:

Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I know I can't have both the 4.0 and 5.0 EnterpriseLibrary assemblies in the bin directory, so I tried added a reference to the 5.0 version of Microsoft.Practices.EnterpriseLibrary.Common in project, but I still get the same error.

How do I use the ScriptManager with EnterpriseLibary 5.0?

Was it helpful?

Solution

Another one of our assemblies (used in the web application) was referencing EnterpriseLibrary.Common 5, EnterpriseLibrary.Logging 5, EnterpriseLibrary.Data 4.1, and EnterpriseLibrary.Logging.Database 4.1.

Once I made sure this assembly was referencing the 5.0 version for all of these assemblies, my error stopped.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top