| Author |
Message |
jr365
Joined: 29 May 2010 Posts: 3
|
Posted: Sat May 29, 2010 7:21 am Post subject: Can't open a .sdc Project modified by Sql Data Compare 8 |
|
|
This is a real big problem for me.
I have a solution where I update the data for my customer on one of their remote databases.
I have a lot of custom table mappings that I've created in the SQL Data Compare application. I was able to successfully use a project file to load custom mappings in version 7 of the api.
However, with version 8 of the api, it seems that I can't load any project that was saved by the current version of sql red gate compare. I am using 8.1.0.4 of Data Compare.
I don't need to include my own code, because your sample code breaks easily enough without anything custom.
Steps to reproduce:
-Open the Solution
-Modify the ProjectExample.cs file like this (we just take out the 'auto-create' logic that generates a blank project every time)
| Code: |
public class ProjectExample
{
private const string projectName = @"testproject2.sdc";
public void RunExample()
{
if (!File.Exists(projectName))
{
Project project = new Project();
project.DataSource1.DatabaseName = Program.DevDatabaseName;
project.DataSource2.DatabaseName = Program.LiveDatabaseName;
project.SessionSettings = SessionSettings.Default;
project.Options = new EngineDataCompareOptions(MappingOptions.Default, ComparisonOptions.Default, SqlOptions.Default);
Console.WriteLine("Saving project");
project.SaveToDisk(projectName);
}
//load up the project
Project project2 = Project.LoadFromDisk(projectName);
|
-find the 'testproject.sdc' file in the sample, and open it in Red Gate Data Compare.
-without changing anything, save as 'testproject2.sdc'
-run sample, and choose option 4 for the project mode.
You will get this exception:
| Quote: |
RedGate.Shared.Utils.IO.Serialization.SerializationInvalidFileTypeException was unhandled
Message=Invalid file testproject2.sdc
Source=RedGate.Shared.Utils
FileName=testproject2.sdc
TypeName=SQLDataCompareProject
StackTrace:
at RedGate.Shared.Utils.IO.Serialization.XMLSerializeFormatter.a(XmlReader , String , String )
at RedGate.Shared.Utils.IO.Serialization.XMLSerializeFormatter.DeserializeRootObject(String fileName, String name, String typeName)
at RedGate.SQLDataCompare.Engine.Project.LoadFromDisk(String fileName)
at SQLDataCompareCodeSnippets.ProjectExample.RunExample() in C:\Program Files\Red Gate\SQL Comparison SDK 8\Samples\Automating SQL Data Compare\C#\ProjectExample.cs:line 29
at SQLDataCompareCodeSnippets.Program.Main() in C:\Program Files\Red Gate\SQL Comparison SDK 8\Samples\Automating SQL Data Compare\C#\Program.cs:line 63
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: |
Questions:
-Is this by design?
-Did you drop this feature?
-How would you recommend I migrate all these custom mappings to a functional state?
Hopefully there is a quick fix! |
|
| Back to top |
|
 |
jr365
Joined: 29 May 2010 Posts: 3
|
Posted: Sat May 29, 2010 8:43 pm Post subject: Command line may be the solution |
|
|
It looks like using the command line version of Sql Data Compare may be the solution.
I can pass in a version 8 project file, and the synchronization works.
| Code: |
| sqldatacompare.exe /pr SF-Sync2.sdc /sf output.sql |
So, is it likely an issue with the sdk then? The downside is that I have to execute batch files instead of managed code, but a working solution is the goal for now. |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6348 Location: Red Gate Software
|
|
| Back to top |
|
 |
jr365
Joined: 29 May 2010 Posts: 3
|
Posted: Mon May 31, 2010 8:54 pm Post subject: Version numbers |
|
|
Hi Brian,
Before trying the patch, I attempted this, and it worked perfetctly:
The problem is that the dlls inside the sdk folder are from product version 7:
And the dlls inside the DataCompare application folder are the current version:
So I just used the dlls from the application directory instead of the sdk directly. Everything seems to work properly
Question:
Can I still deploy my solution to another machine? Will that work? Or do I need to use those special sdk assemblies?
I am not sure why the sdk assemblies are from another version, am I missing something? |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6348 Location: Red Gate Software
|
Posted: Tue Jun 01, 2010 9:41 am Post subject: |
|
|
Hello,
The problem is that the SQL Comparison SDK, as a product, is not updated at the same time as the commercial versions of the products. The "official" release of SDK still contains SQL Compare Engine 8 and SQL Data Compare Engine 7, which is why I had suggested the cumulative patch.
But you can use the dlls from the SQL Data Compare product and they will work in exactly the same way as if they came from the SDK, so if you have got everything set up to use the dlls from Data Compare, you can continue working with them. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
|