2

While publishing the content in sitecore, the following error occured.

Job started: Publish to 'web'|#Exception: System.Reflection.TargetInvocationException:

While checking on logs, i found the error with following language

Could not parse the language 'ms-BD'. Note that a custom language name must be on the form: isoLanguageCode-isoRegionCode-customName.

But that language is not installed, and there are no language corresponding to that code.

UPDATE #1: Add some more log details:

 ERROR Exception
Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj)
at Sitecore.Jobs.JobRunner.RunMethod(JobArgs args)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Jobs.Job.ThreadEntry(Object state)
Nested Exception
Exception: System.AggregateException
Message: One or more exceptions occurred while processing the subscribers to the 'item:saved' event.
Source: Sitecore.Kernel
at Sitecore.Events.Event.EventSubscribers.RaiseEvent(String eventName, Object[] parameters, EventResult result)
at Sitecore.Events.Event.RaiseEvent(String eventName, Object[] parameters)
at Sitecore.Events.Event.RaiseItemSaved(Object sender, ItemSavedEventArgs args)
at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
at Sitecore.Data.Engines.EngineCommand`2.RaiseEvent[TArgs](EventHandler`1 handlers, Func`2 argsCreator)
at Sitecore.Data.Engines.EngineCommand`2.Execute()
at Sitecore.Data.Engines.DataEngine.SaveItem(Item item)
at Sitecore.Data.Managers.ItemProvider.SaveItem(Item item)
at Sitecore.Data.Managers.PipelineBasedItemProvider.ExecuteAndReturnResult[TArgs,TResult](String pipelineName, String pipelineDomain, Func`1 pipelineArgsCreator, Func`1 fallbackResult)
at Sitecore.Data.Managers.PipelineBasedItemProvider.SaveItem(Item item)
at Sitecore.Data.Items.ItemEditing.AcceptChanges(Boolean updateStatistics, Boolean silent)
at Sitecore.Data.Items.EditContext.Dispose()
2
  • anything more in the stacktrace of your error?
    – Marek Musielak
    Oct 22, 2018 at 8:32
  • Is the language defined under the /sitecore/system/Languages node? Oct 22, 2018 at 11:48

1 Answer 1

4

Looks like you are trying to use culture 'ms-BD' that is not present in .NET by default. Check that you definitely need 'ms-BD' and it is not mistake or misprint.

You can check cultures registered in system by running this C# console app:

class Program
{
    static void Main(string[] args)
    {
        CultureInfo[] cinfo = CultureInfo.GetCultures(CultureTypes.AllCultures & ~CultureTypes.NeutralCultures);
        Console.WriteLine("List of cultures registered in system");
        foreach (CultureInfo cul in cinfo)
        {
            Console.WriteLine(cul.DisplayName + "  " + cul.Name);
        }
        Console.ReadLine();
    }
}

I get next cultures:

  • Malay ms
  • Malay (Brunei Darussalam) ms-BN
  • Malay (Malaysia) ms-MY
  • Malay (Latin, Singapore) ms-SG

But you are trying to use 'ms-BD'. Malay (Bangladesh)? If it is not misprint/mistake and you are intended to use 'ms-BD' then you need to register your custom culture:

class Program
{
    static void Main(string[] args)
    {
        string culture = "ms-BD";
        string name = "Malay Bangladesh";

        CultureInfo cultureInfo = new CultureInfo("ms");
        RegionInfo regionInfo = new RegionInfo("BD");

        CultureAndRegionInfoBuilder cultureAndRegionInfoBuilder = new CultureAndRegionInfoBuilder(culture, CultureAndRegionModifiers.None);

        cultureAndRegionInfoBuilder.LoadDataFromCultureInfo(cultureInfo);
        cultureAndRegionInfoBuilder.LoadDataFromRegionInfo(regionInfo);

        // Custom Changes
        cultureAndRegionInfoBuilder.CultureEnglishName = name;
        cultureAndRegionInfoBuilder.CultureNativeName = name;

        cultureAndRegionInfoBuilder.Register();
    }
}

After running this console application on machine where exception was occurred you will get new custom culture that should fix exception.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.