0

This is an occasional random error from my 32bit .net application when it connects to sql server.

System.ApplicationException: A device attached to the system is not functioning. (Exception from HRESULT: 0x8007001F)
   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..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.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)

The System.Threading.TimerBase.AddTimerNative() method is an internal call, see Microsoft source code.

I found another link on the web that discussed about CLR Does CLR internally spawns a thread to respond to timer events?

Since I don't know how AddTimerNative is implemented, I don't know the cause of work around this error.

Community
  • 1
  • 1
chris xiao
  • 21
  • 1
  • 2
    See this: http://stackoverflow.com/questions/6187739/c-sharp-windows-app-a-device-attached-to-the-system-is-not-functioning – Steve Jul 31 '13 at 20:18
  • This is not the same problem. The program runs on Windows server 2008 R2. The program's component is a .net assembly instead of legacy win32 app/dll. – chris xiao Aug 01 '13 at 13:33
  • The solution could be the same. Have you tried it? – Steve Aug 01 '13 at 15:22
  • my program or any component does not use CryptBase.dll – chris xiao Aug 02 '13 at 18:36
  • Maybe there's another assembly that is causing a conflict. Try removing as many dependencies as possible and seeing if the problem goes away. – Steve Aug 03 '13 at 20:12

0 Answers0