C# Windows App A device attached to the system is not functioning

1

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:

  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

StackTrace Information:

  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)

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?

c#
windows-7
asked on Stack Overflow May 31, 2011 by Cole W

1 Answer

0

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.

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.

answered on Stack Overflow Jul 6, 2011 by Cole W

User contributions licensed under CC BY-SA 3.0