採用負載平衡,部署了兩個ASP.NET 2.0的站台伺服器碰到的問題

來源:互聯網
上載者:User
採用負載平衡伺服器的情況下部署兩台站台伺服器,碰到幾個問題及他們的解決辦法。

1. 當將發布好的網站檔案copy到IIS目錄下,配製好IIS對Framework的支援,訪問網站,始終出現Service Unavailable兩個大字,鬱悶....搜尋一番,發現瞭解決辦法:
開啟IIS的websites檔案夾的屬性,然後到Service選項卡,鉤選Run WWW service in IIS 5.0 isolation mode.
如:


這樣設定後,我們的網站在本機終於可以開啟了。

2. 配置第二台Web Server時,按照第一台的步驟部署配置完成,開啟網頁,出現下面的錯誤:This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)

FileLoadException: Could not load file or assembly 'acPDFCreatorLib.Net, Version=3.0.2735.26202, Culture=neutral, PublicKeyToken=8aedc7a81d17941d' or one of its dependencies. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)]
   System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
   System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +211
   System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +141
   System.Reflection.Assembly.Load(String assemblyString) +25
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +32

這裡引用了一個第三方的程式集做PDF->XPS的轉換。奇怪,第一台伺服器沒有任何問題,部署配置是一樣的,包括檔案都是同一個拷貝,而第二台伺服器出現這個錯誤。最後發現是缺少Visual C++ 2005 Redistributable Package,下載安裝後,問題解決了。

3. 兩台Web Server配置完成了,在本地都可以運行了,下面就訪問事先做好的網域名稱(指向均衡負載伺服器),首頁開啟了,輸入帳號密碼登陸,又出現問題了!大黃頁:Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.

經過搜尋找到瞭解決辦法,經如此簡單,web.config做如下修改:<system.web>  
<pages enableViewStateMac="false" />  
</system.web>

終於好了,一切正常了!

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.