Tuesday, June 5, 2012

How to enable Sync to SharePoint Workspace for SharePoint document libraries

Enable Sync to SharePoint Workspace using SharePoint Object Model:



  1. Open Visual Studio 2010.
  2. Go to File => New => Project.
  3. Select Console Application template from the installed templates.
  4. Enter the Name and Click on Ok.
  5. Add the following Reference.

    Microsoft.SharePoint.dll
  6. Add the following Namespace.

    Using Microsoft.SharePoint;
 static void Main(string[] args)
        {
            using (SPSite site = new SPSite("http://demoshare:6969/sites/"))
            {
                using (SPWeb web = site.OpenWeb())
                {
                    SPList list = web.Lists.TryGetList("History");
                    if (list != null)
                    {
                        //Enable Sync to SharePoint Workspace
                        list.ExcludeFromOfflineClient = false;
                        //To Disable Sync to SharePoint Workspace => list.ExcludeFromOfflineClient = true;
                        list.Update();
                        Console.WriteLine("Sync to SharePoint Workspace is Enabled");
                    }
                    else
                    {
                        Console.WriteLine(list.Title + " does not exists in the site");
                    }
                    Console.ReadLine();
                }
            }
        }
  1. Build the solution.
  2. Hit F5.
enabled sync to workspace button.

Error Type:“The Web application at http://sharepointserver could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.”

 building applications in Visual Studio 2010 as Console applications or Windows Forms application,i got above error.
1. Under Project Properties –> Application, Ensure that the target framework to be compiled against is .NET Framework 3.5
 2. Under Project Properties –> Build, Ensure that the platform target is set to x64


Solved this error


Saturday, June 2, 2012

Configuring Forms Based Authentication for SharePoint 2010 using IIS7

Follow This Article Link

ErrorType-"HTTP Error 503. The service is unavailable."

Go to iis ,next select site in application pol


To change the identity acount attached to app pool, select app pool and right click on it. Select the ‘Advanced Settings’.
 Just use administrator and password and it will work or use domain/username and password.

 After Browse The Site its working.