在本地我們調試運行AJAX.NET程序完全沒有問題,但是一旦上傳到服務器就會出現很多Web.config文件異常

在本地我們調試運行AJAX.NET程序完全沒有問題,但是一旦上傳到服務器就會出現很多Web.config文件異常。以下是兩個最爲典型的異常信息:
    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 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. 系統找不到指定的文件。
------------------------------------------------
    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 'System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. 系統找不到指定的文件。

A:這個問題產生的原因還是出在微軟本身,原本我們發佈網站的時候都會自動生成dll文件到程序的bin目錄。但是AJAX.NET 1.0無法自動添加關鍵dll文件到bin目錄。因此需要我們手動添加。
方法很簡單,找到你安裝AJAX.NET 1.0的目錄,一般是C:/Program Files/Microsoft ASP.NET/ASP.NET 2.0 AJAX Extensions/v1.0.61025
把裏面的System.Web.Extensions.dll文件和System.Web.Extensions.Design.dll文件複製到bin目錄下就可以了。當然複製哪個文件要看你Web.config文件的異常信息而定。
 
發佈了38 篇原創文章 · 獲贊 5 · 訪問量 7萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章