【问题标题】:Getting error -2147220472 (Could not start Quickbooks) [closed]出现错误-2147220472(无法启动 Quickbooks)[关闭]
【发布时间】:2014-01-03 13:42:13
【问题描述】:

我在尝试连接到 Quickbooks 时收到错误 -2147220472。该应用程序由 Windows 服务执行。日志文件如下:

I   8788    RequestProcessor    ========= Started Connection =========
I   8788    RequestProcessor    Request Processor, QBXMLRP2 v12.0
I   8788    RequestProcessor    Connection opened by app named 'QBWatcher'
I   8788    RequestProcessor    OS: Microsoft Professional (build 9200), 64-bit
I   8788    RequestProcessor    Current Process is elevated
I   8788    RequestProcessor    Current User is in AdminGroup
I   8788    RequestProcessor    Current Process is ran as Admin
I   8788    RequestProcessor    Current Process Integrity Level : 3000
I   8788    RequestProcessor    Previous instance of QB is going down..! Wait and retry to get a new instance.
I   8788    RequestProcessor    Previous instance of QB is going down..! Wait and retry to get a new instance.
I   8788    RequestProcessor    Previous instance of QB is going down..! Wait and retry to get a new instance.
I   8788    RequestProcessor    Previous instance of QB is going down..! Wait and retry to get a new instance.
I   8788    RequestProcessor    Previous instance of QB is going down..! Wait and retry to get a new instance.
E   8788    RequestProcessor    Could not find or create an instance of QuickBooks using InstanceFinder
I   8788    RequestProcessor    Connection closed by app named 'QBWatcher'
I   8788    RequestProcessor    ========== Ended Connection ==========
I   8788    CertVerifier    The file does not contain an Authenticode signature.

这有时确实有效,但我看不到模式。这可能是什么原因造成的?

简而言之,用于连接的代码如下:

qbxmlConn.OpenConnection2(filename, "QBWatcher", QBXMLRP2Lib.QBXMLRPConnectionType.localQBD);
QBXMLRP2Lib.IAuthPreferences qbAuthPrefs = qbxmlConn.AuthPreferences;                                   
qbAuthPrefs.PutPersonalDataPref(QBXMLRP2Lib.QBXMLRPPersonalDataPrefType.pdpNotNeeded);
qbAuthPrefs.PutUnattendedModePref(QBXMLRP2Lib.QBXMLRPUnattendedModePrefType.umpOptional);
ticket = qbxmlConn.BeginSession(filename, QBXMLRP2Lib.QBFileMode.qbFileOpenDoNotCare);

【问题讨论】:

标签: c# service quickbooks qbxml


【解决方案1】:

这是这个问题的关键:

应用程序由 Windows 服务执行。

由于 QuickBooks 的工作方式,尝试从 Windows 服务连接到 QuickBooks(例如,一个在后台运行的小程序,而不是带有 GUI 的最终用户程序)永远不会可靠地工作。

QuickBooks 使用 GUI 消息泵为 SDK 提供动力 - 因此,如果没有可用的 GUI(例如,即使在没有用户登录计算机时也运行的 Windows 服务中),那么 SDK/API 将不会可用的。

很抱歉带来坏消息。 :-/

你能否让你的程序有一个简单的 GUI,并且只在用户登录时运行(如果他们需要离开计算机,则锁定屏幕)?

【讨论】:

  • 这就是我所担心的。我试图说服权力让我将其作为最小化到任务托盘的表单应用程序运行。另外,如果我理解正确的话,如果用户没有登录,该服务将无法运行,这就是他们告诉我我们首先需要服务的原因。
  • Keith,您是否了解为什么在使用 Windows 服务时它有时会起作用而其他时候不起作用?
  • 有一点我没有提到,服务执行的进程实际上是一个GUI应用程序,它是实际连接到Quickbooks的进程。你认为这应该适用于基思吗?
  • 如果它作为 Windows 服务运行,它将无法可靠地执行。它必须作为正常程序运行,从正常登录的用户会话开始。
  • @KeithPalmerJr。在您的博客中,您提到这可以通过在 dcomcnfg 中配置 qbXMLRP2e 来实现,这仍然是真的吗?
猜你喜欢
  • 1970-01-01
  • 2021-02-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-01-07
  • 1970-01-01
  • 2012-08-22
相关资源
最近更新 更多