Am creating my first form with custom code. My code uses Microsoft.SharePoint.Client for the following code snippet:

        ClientContext clientContext = new ClientContext("http://local.sharepoint/community/mysite");
        SP.List instruments_list = clientContext.Web.Lists.GetByTitle("Instruments");
        CamlQuery cQuery = new CamlQuery();
        ListItemCollection instrument_collection = instruments_list.GetItems(cQuery);


Based on every example I can find this seems to be the correct way to do this and if I enable full trust trust it works fine in InfoPath but when I try to publish it and run it I get a "That assembly does not allow partially trusted callers.” error.

Is there either another way of accessing and updating the list that won't require me to use the Microsoft.SharePoint.Client or is there a way to fix the problem?

It also insists on loading in the form in the InfoPath client rather tan in the browser, which is what it has been set to do?


  • There are no issue in your client context code , Share your infopath form so i try to find that problem – Krumil Patel Jan 24 '17 at 13:53
  • Am new to this forum, what's the best way to share the form? – HuwD Jan 24 '17 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.