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後網站也是可以正常執行的。

publish error allowDefinition='MachineToApplication'

一個老舊的aspx web form專案,調了一些功能建置成功,但進行部署時顯示以下錯誤。 在應用程式層級之外使用註冊為 allowDefinition='MachineToApplication' 的區段發生錯誤。錯誤的原因可能是虛擬目錄尚未在 IIS 中設定為...