-1

We use a combination of codesmith and net tiers to generate Data Access Layer code for our asp.net website.

Suddenly today when trying to generate the code i get the following error.

Generating project "C:\Source\Trunk\Project1V1.0\Project1.csp" outputs...
Compiling template "C:\Source\Trunk\Project1V1.0\CodeGenerationTemplates\NetTiers.cst"...
Template compilation succeeded. (405 ms)
Rendering output 'DBMaster.txt'...
Error: Project1.csp(0,0) Failed to compare two elements in the array.
Stack Trace:
   at System.Array.SorterObjectArray.DepthLimitedQuickSort(Int32 left, Int32 right, Int32 depthLimit)
   at System.Array.Sort(Array keys, Array items, Int32 index, Int32 length, IComparer comparer)
   at CodeSmith.Core.Collections.ObservableList`1.Sort(IComparer comparer)
   at _CodeSmith.NetTiers_cst.Go() in c:\Source\Trunk\Project1V1.0\CodeGenerationTemplates\NetTiers.cst:line 982
   at _CodeSmith.NetTiers_cst.__RenderMethod1(TextWriter writer, Control control) in c:\Source\Trunk\Project1V1.0\CodeGenerationTemplates\NetTiers.cst:line 5017
   at CodeSmith.Engine.DelegateControl.Render(TextWriter writer)
   at CodeSmith.Engine.Control.RenderChildren(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.Render(TextWriter writer)
   at CodeSmith.Engine.CodeTemplate.RenderToString()
   at CodeSmith.Engine.CodeTemplate.RenderToFile(OutputFile outputFile, Boolean overwrite)
   at CodeSmith.Engine.ProjectCodeGenerator.GenerateCode(CodeSmithProject project)
 --> Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
Stack Trace:
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TrySetMetaData(_SqlMetaDataSet metaData, Boolean moreInfo)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more)
   at System.Data.SqlClient.SqlDataReader.Read()
   at SchemaExplorer.SqlSchemaProvider.GetTables(String connectionString, DatabaseSchema database)
   at SchemaExplorer.CachedSchemaProviderProxy.GetTables(String connectionString, DatabaseSchema database)
   at SchemaExplorer.DatabaseSchema.#N2f()
   at SchemaExplorer.SqlSchemaProvider.GetKeysFromReader(IDictionary`2 tables, SafeDataReader reader, Boolean populateTable)
   at SchemaExplorer.SqlSchemaProvider.GetTableKeys(String connectionString, TableSchema table)
   at SchemaExplorer.TableSchema.#i3f()
   at SchemaExplorer.TableSchema.get_ForeignKeys()
   at SchemaExplorer.TableSchema.#1fb(ITableSchema #Zdc, ICollection`1 #5yi)
   at SchemaExplorer.TableDependancyComparer.Compare(Object x, Object y)
   at System.Array.SorterObjectArray.SwapIfGreaterWithItems(Int32 a, Int32 b)
   at System.Array.SorterObjectArray.DepthLimitedQuickSort(Int32 left, Int32 right, Int32 depthLimit)
 --> The wait operation timed out
Stack Trace:

Unable to render output DBMaster.txt, skipping...
Skipping output 'DBChild.txt'...
Done rendering outputs: 0 succeeded, 1 failed, 1 skipped (104816ms).

As far as I know, nothing has changed since the last time we generated code. But suddenly this error started.

Please note this is a legacy website. Currently we only maintain this site. Could someone please help me understand what's causing this.

Thanks

Kranthi
  • 1
  • 1
  • 1
    `Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Stack Trace:` I think your database timed out. – mjwills Mar 16 '18 at 12:09
  • Thanks, your comment has put me in the right direction. I was hung up on the error 'Failed to compare two elements in the array.', trying to understand why it happened. So I restarted my machine now and that's made my code generation to work. – Kranthi Mar 16 '18 at 14:40

1 Answers1

0

Just so we have a solution listed.

" Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Stack Trace: I think your database timed out. – mjwills "

Jereme
  • 630
  • 6
  • 18