KeyNotFoundException in BuildFromDifferences
doa
Posts: 5
Hi
I use SDK 8 to generate a change script between two databases.
I got a KeyNotFoundException from BuildFromDifferences.
"The given key was not present in the dictionary."
The difference collection contains several elements and seems OK
Stacktrace:
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at S..ctor(Permissions permissions, Permissions targetPermissions, Options options)
at RedGate.SQLCompare.Engine.Permissions.a(IBlockWriter , Options , Permissions , Boolean , Boolean , String , Boolean& )
at RedGate.SQLCompare.Engine.Work.a(Options , IBlockWriter , U , Boolean )
at RedGate.SQLCompare.Engine.Work.GenerateSql(Differences differences, Difference onlyDifferenceToInclude, Options options, Boolean runOnTwo)
at RedGate.SQLCompare.Engine.Work.BuildFromDifferences(Differences differences, Difference onlyDifferenceToInclude, Options options, Boolean runOnTwo)
at RedGate.SQLCompare.Engine.Work.BuildFromDifferences(Differences differences, Options options, Boolean runOnTwo)
at GenerateDiffScript(String connectionString) in file
FileVersion info:
RedGate.SQLCompare.Engine.dll - 8.1.0.148
I cannot see that I'm doing something wrong? Is there a bug in SQL Comparison SDK 8?
I use SDK 8 to generate a change script between two databases.
Database sourceDB = new Database(); Database destinationDB = new Database(); sourceDB.Register(new ConnectionProperties(sServer, sDB, sUser, sPass), Options.Default); destinationDB.Register(new ConnectionProperties(dServer, dDB, dUser, dPass), Options.Default); Differences differences = sourceDB.CompareWith(destinationDB, Options.Default); foreach (Difference difference in differences) difference.Selected = true; Work work = new Work(); work.BuildFromDifferences(differences, Options.Default, true);
I got a KeyNotFoundException from BuildFromDifferences.
"The given key was not present in the dictionary."
The difference collection contains several elements and seems OK
Stacktrace:
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at S..ctor(Permissions permissions, Permissions targetPermissions, Options options)
at RedGate.SQLCompare.Engine.Permissions.a(IBlockWriter , Options , Permissions , Boolean , Boolean , String , Boolean& )
at RedGate.SQLCompare.Engine.Work.a(Options , IBlockWriter , U , Boolean )
at RedGate.SQLCompare.Engine.Work.GenerateSql(Differences differences, Difference onlyDifferenceToInclude, Options options, Boolean runOnTwo)
at RedGate.SQLCompare.Engine.Work.BuildFromDifferences(Differences differences, Difference onlyDifferenceToInclude, Options options, Boolean runOnTwo)
at RedGate.SQLCompare.Engine.Work.BuildFromDifferences(Differences differences, Options options, Boolean runOnTwo)
at GenerateDiffScript(String connectionString) in file
FileVersion info:
RedGate.SQLCompare.Engine.dll - 8.1.0.148
I cannot see that I'm doing something wrong? Is there a bug in SQL Comparison SDK 8?
Comments
I'm already refering RedGate.SQLCompare.Engine.dll version 8.1.0.148
MSSQL 2008 was released over one year ago. Are you saying that i am the first one trying make a change script on SQL server 2008 with "view change tracking permission" with SDK 8.1?