2015年11月17日 星期二

VS2015 部署問題 BC30456: 'InitializeCulture'

使用VS2015 publish web app後,部份aspx的程式進入後顯示以下錯誤訊息,

編譯錯誤

描述: 資源編譯無法完成 (錯誤發生於服務要求)。請檢閱下列的特定錯誤詳細資料,並視情況修改您的原始程式碼。

編譯器錯誤訊息: BC30456: 'InitializeCulture' 不是 'ASP.test0200_search_aspx' 的成員。

查看顯示詳細的編譯器輸出資料後,有顯示這麼一段可疑的訊息

 C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\test\bac62fb0\75a1220a\App_Web_eghhxrxs.0.vb(45) : error BC30560: 'test0200_search' 在命名空間 'menu' 中模稜兩可。 Inherits Global.menu.test0200_search

所以用關鍵字test0200_search進行搜尋後,發現有二個.aspx 有相同的Inherits="menu.test0200_search" %>同時也關連到了code behind .aspx.vb的class名稱,更改為正確的Inherits="menu.test0200_search1" 後,網站執行就正常了。

我想這隻aspx應該是copy and paste修改來的吧。


同時,在這篇討論中 http://forums.asp.net/t/955888.aspx?BC30456+InitializeCulture+is+not+a+member+of+

也提供一個解決方法

During the publishing stage on framework 2.0 uncheck the "allow this precompiled site to be updatable".  Once I unchecked this it published correctly and functioned correctly on IIS.  With it checked I would always receive 'InitializeCulture' is not a member of ...

 試了一下publish web app時,在部署設定選項中不勾選precompiled後網站也是可以正常執行的。

IIS 網站無法下載中文檔名檔案因為取消高位元字元

 網址+中文檔案名稱方式下載檔案顯示 404 - 找不到檔案或目錄。 但英數字檔案名稱則可下載。 因為設定GCB IIS,其中1項 將高位元字元預設取消勾選了。 27 TWGCB-04-014-0028 要求篩選與其他限制模組 允許高位元字元 這項原則設定決定查詢...