2
我使用NodaTime獲取TypeInitializationException,但僅在發佈中且僅在設備上發佈。NodaTime TypeInitializationException僅限設備,僅發佈
這裏的堆棧跟蹤:
System.TypeInitializationException: The type initializer for 'Patterns' threw an exception. ---> System.TypeInitializationException: The type initializer for 'NodaTime.Text.ZonedDateTimePattern' threw an exception. ---> System.TypeInitializationException: The type initializer for 'NodaTime.DateTimeZone' threw an exception. ---> System.TypeInitializationException: The type initializer for 'NodaTime.Text.OffsetPattern' threw an exception. ---> System.Resources.MissingManifestResourceException: Exception of type 'System.Resources.MissingManifestResourceException' was thrown.
at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
at NodaTime.Globalization.NodaFormatInfo.get_OffsetPatternLong()
at NodaTime.Text.OffsetPatternParser.ParsePartialPattern(String patternText, NodaFormatInfo formatInfo)
at NodaTime.Text.OffsetPatternParser.CreateGeneralPattern(NodaFormatInfo formatInfo)
at NodaTime.Text.OffsetPatternParser.ParsePartialPattern(String patternText, NodaFormatInfo formatInfo)
at NodaTime.Text.OffsetPatternParser.ParsePattern(String patternText, NodaFormatInfo formatInfo)
at NodaTime.Text.FixedFormatInfoPatternParser`1.<>c__DisplayClass0.<.ctor>b__2(String patternText)
at NodaTime.Utility.Cache`2.GetOrAdd(TKey key)
at NodaTime.Text.OffsetPattern.Create(String patternText, NodaFormatInfo formatInfo)
at NodaTime.Text.OffsetPattern..cctor()
--- End of inner exception stack trace ---
at NodaTime.TimeZones.FixedDateTimeZone.MakeId(Offset offset)
at NodaTime.DateTimeZone.BuildFixedZoneCache()
at NodaTime.DateTimeZone..cctor()
--- End of inner exception stack trace ---
at NodaTime.LocalDateTime.InUtc()
at NodaTime.Text.ZonedDateTimePattern..cctor()
--- End of inner exception stack trace ---
at NodaTime.Text.ZonedDateTimePattern.CreateWithInvariantCulture(String patternText, IDateTimeZoneProvider zoneProvider)
at NodaTime.Text.ZonedDateTimePattern.Patterns..cctor()
--- End of inner exception stack trace ---
at NodaTime.ZonedDateTime.ToString(String patternText, IFormatProvider formatProvider)
at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
at System.Text.StringBuilder.AppendFormat(String format, Object[] args)
at Models.EventSummary.get_DisplayDate()
嗯。有趣。你的文化是什麼?我希望它能回落到我爲大會指定的任何文化中去......它不像是有其他文化的那種資源。嗯。 – 2014-10-11 17:50:09
當你說它是「只在發佈中」時 - 大概你在這兩種情況下都使用相同的Noda Time程序集,安裝bu NuGet? – 2014-10-11 17:50:39
是的,一切都是通過NuGet設置的。 – Jeff 2014-10-11 18:12:36