我期待解決這個錯誤:當我複製log4net.dll我的web應用程序的bin目錄錯誤:無法加載log4net的裝配
Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified." This error is located in the web.config file.
,我得到一個
Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.
這web.config文件中也會出現錯誤。
很容易更改版本和公鑰標記以匹配文件,以便程序集正確加載。當我這樣做時,我的網站完美運行,除了初始化reportViewer
對象時。然後它會在reportViewer標記處引發原始錯誤,而不是web.config。
我的假設是,如果我安裝log4net.dll
的請求版本,我的問題將得到解決。但我不知道哪個文件或哪裏可以找到它。我已經通過下載log4net 1.2.10檢查了明顯的情況,並嘗試了下載中的每個dll。
我應該提到網站在我的開發機器上運行時沒有問題,但是在發佈到我的服務器時沒有問題。
我在Server 2008 R2操作系統上運行一個asp.net網站,.NET 4.0,IIS 7。我已經爲64位安裝了Crystal Reports 13.0.1(我的機器是64位)。
我該如何解決這個問題?
編輯: 回覆@ Kevian的回答,我已經改變了我的web.config文件。清單定義與程序集引用不匹配時,仍然出現錯誤。引發此錯誤的代碼是:
Line 33: <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true"
Line 34: BestFitPage="True" ToolPanelView="None" />
是一個解決方案發現了什麼? – tomfanning 2013-01-28 14:57:05