/Sébastien
Downlad and install the Sync Toolkit for WinRT
This tutorial is a part of a fully global tutorial :
- Download and install Sync Framework and Sync Toolkit for WinRT
- Generate the code for your database, your server and your client application
- Create a fully functional application
- Create a filtered application based on a template scope
- Handle conflicts
Setup processus
To create a “synchonizable application” that will work on Windows Store apps and Windows Phone 8, you need to create:
- A web server, which will expose all your entities, and capable of querying and updating a database (SQL SERVER in our example)
- Your datas come from a SQL SERVER database, which will be configured to allow synchronization with the Sync Framework
- A Windows store apps developed in XAML / C#, which will be capable to query your web server and by the way, store all the datas locally in a SQLite database
- A Windows Phone 8 application developed in XAML / C#, which will be capable to query your web server and by the way, store all the datas locally in a SQLite database
Before starting to develop your projects, be sure to meet those requirements. I know this part is boring, sometimes, but you need to read it carefuly
Server

Before starting, you must install on your server, the latest version of
Sync Framework 2.1 for .NET:
You have to choose between the x64 version and x86 version :
http://www.microsoft.com/en-us/download/details.aspx?id=23217
Visual Studio and Sync Framework
If you install it on a x64 developer machine, you must install both of them,
BUT you can’t install both of the x64 and x86 version of the SDK.
The solution is to install :
- the x64 version (http://www.microsoft.com/en-us/download/details.aspx?id=23217)
- the redistributables of the x86 version (http://www.microsoft.com/en-us/download/details.aspx?id=19502: Install the 3 msi)
Once everything installed, you can get the toolkit from Nuget :
https://www.nuget.org/packages/SyncClient.SQLite/

During the preparation of your web server solution, you will have thoses assemblies :

- The first three are part of the Sync Framework 2.1
- Microsoft.Synchronization
- Microsoft.Synchronization.Data.Server
- Microsoft.Synchronization.Data.SqlServer
- The last one come from the Sync ToolKit nuget Package :
- Microsoft.Synchronization.Services
Note: I strongly suggest to you to install a local IIS on your development machine. Working with Windows Phone 8 and a locally IIS server is usually more simple and confortable.

However, if you don’t have a locally IIS web server installed, you have two solutions :
- Install IIS on your local machine (It’s a good thing, don’t be afraid
)
- Try to connect your emulator on IIS Express. You can check this todo article :
How To Connect a local web service from Windows Phone 8
- No third option, but you can also … install IIS on your local machine !
Note : As you can imagine, in the followings sections, I will use a local IIS web server.
Windows Store Apps
Regarding the Windows store apps development, the first thing to do is to install
SQLite on your machine.
Thanks to Extensions and Update, you just have to search SQLite for Windows Runtime and install it. We will see that you will have to repeat this operation for Windows Phone 8

You can now add the reference to the toolkit with Nuget :

Here is a screenshot of my WinRT client project references:

- SQLite for Windows Runtime : Obvious
- Microsoft.Synchronization.ClientServices.Win8 : WinRT Toolkit C# assembly installed by the Nuget package
- SQLitePCL wrapper from MSOpenTech to access SQLite from a C# application
- Microsoft Visual C++ Runtime Package : Required by SQLite
Widows Phone 8
As we have seen previously, you have to install SQLite for Windows Phone with Extensions and Updates

And once again, install the WinRT Toolkit with the Nuget package :) :

Here is a screenshot of my Windows Phone 8 project references :

- SQLite for Windows Phone : SQLite dlls for WP8
- Microsoft.Synchronization.ClientServices.WP8 : Toolkit Windows Phone 8
- SQLitePCL wrapper from MSOpenTech to access SQLite from a C# application
Here we go, you can synchronize your application right now !