I have a ASP.NET Web Service and inside it I'm using SharePoint 2010 Client Object Model. The promblem is that I'm using a CAML Query to retrive some items for a user that is given. When I choose, so that my app uses the Visual Studio Development Server, all works properly, but when I switch to Local IIS Web server, the CAML returns 0 items what so ever.
ClientContext clientContext = new ClientContext("http://mySiteCol");
Web web = clientContext.Web;
var query = from list in web.Lists
where list.Title == "listName"
select list;
var result = clientContext.LoadQuery(query);
clientContext.ExecuteQuery();
List lista = result.ToList().FirstOrDefault();
CamlQuery camlQuery = new CamlQuery();
camlQuery.ViewXml = string.Format("<View><Query><Where>" +
"<Eq><FieldRef Name='staticColumnName' />" +
"<Value Type='User'>{0}</Value></Eq>" +
"</Where></Query></View>", userName);
ListItemCollection listItemCollection = lista.GetItems(camlQuery);
clientContext.Load(listItemCollection);
clientContext.ExecuteQuery();
CAML dind't work with user ID either.
Thanks.