When you try to use the Client Object Model (SharePoint 2010) with Windows Application in Visual Studio 2010, you might be getting these error messages. (You can find the step by step instructions to use the SharePoint 2010 Client Object Model here)
Error Message:
'Form' is an ambiguous reference between 'System.Windows.Forms.Form' and 'Microsoft.SharePoint.Client.Form'
Reason: The reason is obvious and we can get from the error message itself. Yes, after added the SharePoint Client reference to the code, there is a conflict between ‘System.Windows.Forms.Form’ and ‘Microsoft.SharePoint.Client.Form’! Initially our Form1 class inherits from Form class (by default System.Windows.Forms.Form) and currently our program confuses to choose the correct reference.
Solution: Provide full reference to the Form class will be the solution for this issue, so replace ‘Form‘ with ‘System.Windows.Forms.Form‘
After Replacing the code:
public partial class Form1 : System.Windows.Forms.Form { public Form1() { InitializeComponent(); } }
That’s all guys, Happy Programming with Client Object Model.
Thanks, R../