What are the challenges you face when working across database platforms? Take the survey

Failed to compare two elements in the array

JoshNoeJoshNoe Posts: 4
We recently updated the RedGate Compare SDK dlls, and now our previously working app is throwing an error when we call RedGate.SQLCompare.Engine.Database.LoadFromDisk("mysnapshot.snp")

"Failed to compare two elements in the array"

The version appears to be, even though I got the dlls from "SDK 10" which I downloaded eariler today.

Stack trace:
at System.Collections.Generic.ArraySortHelper`1.Sort(T[] keys, Int32 index, Int32 length, IComparer`1 comparer)
at System.Collections.Generic.List`1.Sort(Int32 index, Int32 count, IComparer`1 comparer)
at RedGate.SQLCompare.Engine.Indexes.Sort()
at RedGate.SQLCompare.Engine.Indexes.#gjh()
at RedGate.SQLCompare.Engine.Table.PatchUpAfterDeserialization(Database #RHc)
at RedGate.SQLCompare.Engine.Tables.PatchUpAfterDeserialization(Database #RHc)
at RedGate.SQLCompare.Engine.Database.PatchUpAfterDeserialization(Boolean #pXrc)
at RedGate.SQLCompare.Engine.Database.LoadFromStream(Stream #a0, Database #uwL)
at RedGate.SQLCompare.Engine.Database.LoadFromDisk(String #wqk, Database #uwL)
at RedGate.SQLCompare.Engine.Database.LoadFromDisk(String fileName)
at ReleaseUpdate.Synchronizer.SQLSynchronizer(BackgroundWorker worker, DoWorkEventArgs e) in C:\SPIDev\SPITools\PRIME\AutoUpdate\Synchronizer.vb:line 125


  • Options
    SOLVED: Make sure you include ALLLLLLL the library files in the folder "E:\Program Files (x86)\Red Gate\SQL Comparison SDK 10\Assemblies\SQL Data Compare
    " to your project, the actual error i got had NOTHING to do with the actual issue (missing an assembly file) i noticed it was an inner exception to the exception. Good luck all

    If i use an empty database i do not get the "failed to compare two elements in the array" message. To bad i have a very complicated database i need to use this on (and my trial is running out) so if i cannot get this to work soon i will move onto the next solution in my list of things to try.

    ConnectionProperties sourceConnectionProperties = new ConnectionProperties(txtToSqlUrl.Text, txtToDBName.Text, txtToUsername.Text, txtToPassword.Text);

    RedGate.SQLCompare.Engine.Database sourceDatabase = new RedGate.SQLCompare.Engine.Database();
    //(error's on the next line)
    sourceDatabase.Register(sourceConnectionProperties, Options.Default);
Sign In or Register to comment.