连接到系统的C#Windows应用程序的设备不能正常工作 [英] C# Windows App A device attached to the system is not functioning

查看:331
本文介绍了连接到系统的C#Windows应用程序的设备不能正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到以下异常从窗户进来Windows 7的计算机上的窗体应用程序。这只是开始发生这台机器上。它仍然适用于别人,但不是一个特定的计算机上细

I'm seeing the following exception coming from a windows forms application on a windows 7 machine. This just started happening on this machine. It still works fine on others but not on a particular machine.

例外:

  Exception Type: System.ApplicationException
  Message: A device attached to the system is not functioning.  (Exception from HRESULT: 0x8007001F)
  Data: System.Collections.ListDictionaryInternal
  TargetSite: Void AddTimerNative(System.Object, UInt32, UInt32, System.Threading.StackCrawlMark ByRef)
  Source: mscorlib

堆栈跟踪信息:

  at System.Threading.TimerBase.AddTimerNative(Object state, UInt32 dueTime, UInt32 period, StackCrawlMark& stackMark)
  at System.Threading.TimerBase.AddTimer(TimerCallback callback, Object state, UInt32 dueTime, UInt32 period StackCrawlMark & stackMark)
  at System.Threading.Timer.TimerSetup(TimerCallback callback, Object state, UInt32 dueTime, UInt32 period, StackCrawlMark & stackMark)
  at System.Threading.Timer..ctor(TimerCallback callBack, Object state, Int32 dueTime, Int32 period)
  at System.Data.ProviderBase.DbConnectionPool.CreateCleanupTimer()
  at System.Data.ProviderBase.DbConnectionPool.Startup()
  at System.Data.ProviderBase.DbConnectionPoolGroup.GetConnectionPool(DbConnectionFactory connectionFactory)
  at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPool(DbConnection owningObject, DbConnectionPoolGroup connectionPoolGroup)
  at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
  at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
  at System.Data.SqlClient.SqlConnection.Open()
  at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
  at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
  at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
  at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)

此外,这似乎在第一个查询是在应用程序运行的情况发生。我可以通过ODBC连接连接到数据库服务器的那台机器上,所以我知道自己机器可以看到数据库服务器。有什么建议?

Also this seems to happen on the first query being ran in the application. I can connect to the database server via ODBC connections on that machine so I know the machine can see the database server. Any suggestions?

推荐答案

原来,这个错误是相关的程序中使用了我们公司写了一个dll。这似乎只在Windows 7中出现。

It turns out this error was related to a dll the program was using that our company wrote. This only seems to occur in windows 7.

问题是我们用的是调用的DLL CryptBase.dll 但Windows 7还附带了它的自己的 CryptBase.dll 。我的公司版本必须已经尽快与Windows版本,因为冲突的,因为我们删除了这个dll的程序开始工作的版本。

The problem was we were using a dll called CryptBase.dll but Windows 7 also comes with it's own CryptBase.dll. My companies version must have been conflicting with the windows version because as soon as we removed our version of this dll the program started working.

这篇关于连接到系统的C#Windows应用程序的设备不能正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆