SP 2013 Online CSOM Portable Search Unable to cast result

Hi,

I'm trying to use sharepoint portable dll for an Universal Windows App.

Here is my code:

using (ClientContext ctx = new ClientContext("************"))
            {
                ctx.Credentials = new SharePointOnlineCredentials("*********", "**********");
                KeywordQuery keywordQuery = new KeywordQuery(ctx);
                keywordQuery.QueryText = "******";
                keywordQuery.QueryTemplate = "*********";
                SearchExecutor searchExecutor = new SearchExecutor(ctx);
                var results = searchExecutor.ExecuteQuery(keywordQuery);
                await ctx.ExecuteQueryAsync();
            }

When portable dll tries to cast the search result I get this exception:

Unable to cast object of type 'System.Collections.Generic.Dictionary`2[System.String,System.Object]' to type 'Microsoft.SharePoint.Client.Search.Query.ResultTableCollection'.

If I use the not portable dll the query return results without errors.

Any thoughts would be appreciated.

Thanks.

Andrea

August 30th, 2015 1:00pm

Hi Andrea,

Please check the below

http://stackoverflow.com/questions/29454871/search-with-sharepoint-csom-portable-throws-an-exception

Free Windows Admin Tool Kit Click here and download it now
August 30th, 2015 1:31pm

Hi Andrea,

Please check the below

http://stackoverflow.com/questions/29454871/search-with-sharepoint-csom-portable-throws-an-exc

September 8th, 2015 2:49pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics