【问题标题】:getting "Input string was not in a correct format" upon starting QuickFixN启动 QuickFixN 时出现“输入字符串格式不正确”
【发布时间】:2014-12-15 17:41:58
【问题描述】:

我有一个 C# 应用程序已经成功使用 QuickFixN 一段时间了。

今天早上机器崩溃后,当我重新启动时,我在这里得到“输入字符串格式不正确”:

    System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at System.Convert.ToInt32(String value)
   at QuickFix.FileStore.ConstructFromFileCache()
   at QuickFix.FileStore.open()
   at QuickFix.FileStore..ctor(String path, SessionID sessionID)
   at QuickFix.FileStoreFactory.Create(SessionID sessionID)
   at QuickFix.Session..ctor(IApplication app, IMessageStoreFactory storeFactory, SessionID sessID, DataDictionaryProvider dataDictProvider, SessionSchedule sessionSchedule, Int32 heartBtInt, ILogFactory logFactory, IMessageFactory msgFactory, String senderDefaultApplVerID)
   at QuickFix.SessionFactory.Create(SessionID sessionID, Dictionary settings)
   at QuickFix.AbstractInitiator..ctor(IApplication app, IMessageStoreFactory storeFactory, SessionSettings settings, ILogFactory logFactory, IMessageFactory messageFactory)
   at QuickFix.Transport.SocketInitiator..ctor(IApplication application, IMessageStoreFactory storeFactory, SessionSettings settings, ILogFactory logFactory)

我该如何纠正?

【问题讨论】:

  • 首先发布崩溃的代码以及输入值。
  • 那是 QuickFix 里面的,我不知道输入值是什么
  • 由于这个网站是用于编程的,我不确定我们将如何帮助您。也许这会在Super User 做得更好
  • FWIW,这是一个 c# 错误,当您尝试将字符串解析为数字并且字符串不是数字时会发生这种错误。
  • 谢谢,明白了。刚刚解决了,所以我还是发布了一个答案。

标签: c# quickfix


【解决方案1】:

删除所有 QuickFix 存储解决了问题。

显然这有点危险 - 消息可能会丢失。

【讨论】:

  • 不正确。您删除了 store (在堆栈跟踪中引用)。存储和日志是完全不同的东西,虽然傻瓜有时会将它们配置到同一个目录中。
  • 你是对的,我已经删除了商店,这已经解决了问题。我认为我没有启用日志记录
【解决方案2】:

希望您备份商店?如果您按时间戳对商店进行排序,您可以找到导致问题的消息...

【讨论】:

  • 我有,但显然商店有多个文件 - 我应该查看哪个文件?
  • 您可以从正文文件中获取一些信息,但我不确定它是否记录了异常。 cfg 文件中的文件日志路径是什么?导航到那里并查看 messages.current.log
猜你喜欢
  • 2018-01-01
  • 1970-01-01
  • 2011-10-20
  • 1970-01-01
  • 1970-01-01
  • 2022-01-23
相关资源
最近更新 更多