2012年6月15日 星期五

ASP .NET MVC3 多語系問題

最近開始摸索ASP .NET的MVC架構,也順便將多國語言一併納入
依照網路文章教學或是相關書籍的做法,再新增語系Resource與設定後執行,會出現下列的錯誤訊息(分別列出中英文對照,MyMVC,是我在練習的APP名稱,):


中文錯誤訊息:
找不到任何適用特定文化特性或中性文化特性的資源。請確定您已在編譯時期正確地將 "MyMVC.App_GlobalResources.Resource.resources" 嵌入或連結至組件 "MyMVC" 中,或所有需要的附屬組件均為可載入且已完整簽署。

英文錯誤訊息:
Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "MyMVC.App_GlobalResources.Resource.resources" was correctly embedded or linked into assembly "MyMVC" at compile time, or that all the satellite assemblies required are loadable and fully signed.

原因是出自於,在建立Resource檔後,Resource建置動作預設為內容,畫面如下圖所示


因為這樣所以出現了上述的錯誤訊息,必須將此動作修正為內嵌資源,畫面如下所示

如此問題就解覺了~:)



沒有留言:

張貼留言