HangfireIO/Hangfire

System.Globalization.CultureNotFoundException. Culture is not supported.

オープン

#964 opened on 2017/08/11

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)C# (1,748 件のフォーク)batch import
a: corehelp wanted

Repository metrics

Stars
 (10,068 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

I'm using:

  • HangFire.Core v1.4.6
  • Hangfire.SqlServer v1.4.6
  • Windows 10 x64
  • IIS 8.5 (not important probably but still)

Suddenly I got failed jobs containing next exception:

System.Globalization.CultureNotFoundException

Culture is not supported. Parameter name: name en-SI is an invalid culture identifier.

System.Globalization.CultureNotFoundException: Culture is not supported.
Parameter name: name
en-SI is an invalid culture identifier.
   at System.Globalization.CultureInfo..ctor(String name, Boolean useUserOverride)
   at Hangfire.CaptureCultureAttribute.OnPerforming(PerformingContext filterContext)
   at Hangfire.Server.BackgroundJobPerformer.InvokePerformFilter(IServerFilter filter, PerformingContext preContext, Func`1 continuation)

Hangfire was using two servers if that makes any difference. After deleting all Hangfire tables it now works, but still don't know why this happened.

But why does CultureNotFoundException occurs? Thread is always running under valid culturename. I found next post: https://stackoverflow.com/questions/38690850/disable-preservecultureattribute-in-hangfire

コントリビューターガイド