2016-10-19 16 views
1

サイトコードから「デンマーク語」を削除しました。私の解決策では、コードSitecore.Context.Language.Nameをどこまで使用したのか例外が発生しています。私はその後、私はエラーを取得しないreturn Dictionary["en"];に置き換える場合Sitecore 8:言語を削除するとKeyNotFoundException例外が発生しました

はここで例外

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. 

上記のコードで全体のスタックトレース

Source Error: 
Line 22:   static Model.Localization.CommonDictionary GetCommonLocalizations() 
Line 23:   { 
Line 24:    return Dictionary[Sitecore.Context.Language.Name]; 
Line 25:   } 
Line 26:   public static string DefaultActivityTitle { get { return GetCommonLocalizations().DefaultActivityTitle; } } 

Source File: E:\IIS Data\MySite\Utilities\SF.ISK.Kernel\Localisation\CommonDictionary.cs Line: 24 

Stack Trace: 
[KeyNotFoundException: The given key was not present in the dictionary.] 
    System.Collections.Generic.Dictionary`2.get_Item(TKey key) +13763207 
    SF.ISK.Kernel.Localisation.CommonDictionary.GetCommonLocalizations() in E:\IIS Data\MySite\Utilities\SF.ISK.Kernel\Localisation\CommonDictionary.cs:24 
    SF.ISK.Kernel.Localisation.CommonDictionary.get_HtmlTitleTemplate() in E:\IIS Data\MySite\Utilities\SF.ISK.Kernel\Localisation\CommonDictionary.cs:136 
    SF.ISK.Website.layouts.ISK.ISKMainPageLayout.GetPageTitle() in E:\IIS Data\MySite\Website\layouts\ISK\ISK.MainPage.aspx.cs:51 
    SF.ISK.Website.layouts.ISK.ISKMainPageLayout.Page_Load(Object sender, EventArgs e) in E:\IIS Data\MySite\Website\layouts\ISK\ISK.MainPage.aspx.cs:41 
    System.Web.UI.Control.OnLoad(EventArgs e) +109 
    System.Web.UI.Control.LoadRecursive() +68 
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4498 

です。

+0

スタックトレース全体を投稿できますか? –

+0

そして 'Sitecore.Context.Language.Name'の値は何ですか?それは 'da-DA'ですか?デバッグしてみて –

+0

はい、それでも私に 'da'を与えます。 – Kamran

答えて

0

あなたのアイテムにバージョンda-dkがある可能性があります。 da-dkバージョンを削除して公開します。

削除されたda-dkを探しているうちに、sitecoreがこのキーを見つけることができない可能性があります。

関連する問題