SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Trying (desperately) to find the Microsoft.Sharepoint.Client equivalent of SPList.Fields.Addlookup

My code:

ClientContext ctx = new ClientContext("http://sharepoint/");
Web website = ctx.Web;
ListCreationInformation ci = new ListCreationInformation();
ci.Title = "MyList";
ci.TemplateType = (int)ListTemplateType.GenericList; 
List lst = website.Lists.Add(ci);
lst.AddLookup // <- THIS DOES NOT EXIST
lst.Fields.AddLookup // <- NOR DOES THIS 

I've tried using AddFieldAsXml with every conceivable combination of attributes/values - no luck

Any help would be greatly appreciated !

share|improve this question

You can create a new instance of the FieldLookup object and then use

FieldLookup myLookupField;
//Configuration of Field Stuff
share|improve this answer
Tried that, unfortunately you can't new up a LookupField without knowing the 'object path' - the signature is FieldLookup fld = new FieldLookup([ClientRuntimeContext Context], [ObjectPath ObjectPath]); There's no documentation on the constructor - it seems that MS has reservered it for internal use - (mind you, if there IS another way to create the Lookfield , please let me know) – Marc Apr 25 '12 at 17:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.