Red Gate forums :: View topic - Can't open a .sdc Project modified by Sql Data Compare 8
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Comparison SDK Previous Versions
SQL Comparison SDK Previous Versions forum

Can't open a .sdc Project modified by Sql Data Compare 8

Search in SQL Comparison SDK Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
jr365



Joined: 29 May 2010
Posts: 3

PostPosted: Sat May 29, 2010 7:21 am    Post subject: Can't open a .sdc Project modified by Sql Data Compare 8 Reply with quote

This is a real big problem for me. Sad

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
View user's profile Send private message
jr365



Joined: 29 May 2010
Posts: 3

PostPosted: Sat May 29, 2010 8:43 pm    Post subject: Command line may be the solution Reply with quote

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
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6644

PostPosted: Mon May 31, 2010 12:32 pm    Post subject: Reply with quote

Hi Jeremiah,

Can you please try the latest cumulative patch to SQL Comparison SDK?
ftp://support.red-gate.com/patches/SQL_Comparison_SDK/SQL_Comparison_SDK_8_cumulative_patch.zip

The only valid explanation is that there was a file format change to the SDC files that was not implemented in the SDK. The latest SDK should sort that out, if that's the case.

Also, don't forget to run ReplayUserActions to get your mappings from the project file. This was moved in SDK v8:
http://labs.red-gate.com/index.php/SQL_Data_Compare_project
Back to top
View user's profile Send private message
jr365



Joined: 29 May 2010
Posts: 3

PostPosted: Mon May 31, 2010 8:54 pm    Post subject: Version numbers Reply with quote

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
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6644

PostPosted: Tue Jun 01, 2010 9:41 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group