Search code examples
c#socketsmicrosoft-sync-frameworkwindows-server-2012-r2

Sync Framework 2.1 Socket forbidden


I am using Sync Framework 2.1 in Windows 8.1 (C#,XAML). I am using SQL Server 2012 and Windows Server 2012 R2. I configured Sync in server and client app.

But while trying to do sync, I am getting following error.

var offlineContext = new DefaultScopeOfflineContext(DatabaseName, new Uri(SyncServerUri, UriKind.Absolute));
await offlineContext.SynchronizeAsync();

An attempt was made to access a socket in a way forbidden by its access permissions

Error code : 10013

When I keep fiddler open, I dont see this error. Otherwise I am getting this error. I tried disabling anti virus software in server and added inbound rule to allow port 80 through firewall. Nothing works.

Any other suggestion?


Solution

  • Finally I am able to solve it by myself. In Windows 8.1 application, the option Private Network (Client and server) must be checked in the package manifest file. That is it. !!!

    Screenshot of package manifest