Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

I am trying to write a plugin which has to search through files in sharepoint and return path. For I need to use assembly -- "'Microsoft.SharePoint.Client.Search, Version=16.1.0.0," But error says,above assembly could not be loaded.

(0) ShareShare
ReportReport
Posted on by 17

  I am trying to write a plugin which has to search through files in sharepoint and return path. For I need to use assembly -- "'Microsoft.SharePoint.Client.Search, Version=16.1.0.0," How ever I am getting the below error.

Unhandled exception:
Exception type: System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]
Message: An unexpected error occurred from ISV code. (ErrorType = ClientError) Unexpected exception from plug-in (Execute): Sharepoint_searchkeyword.searchkeyword: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SharePoint.Client.Search, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.Detail:
<OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
<ActivityId>1fdb3743-9e2d-42df-a863-a99eedf6c9d0</ActivityId>
<ErrorCode>-2147220956</ErrorCode>
<ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic" />
<Message>An unexpected error occurred from ISV code. (ErrorType = ClientError) Unexpected exception from plug-in (Execute): Sharepoint_searchkeyword.searchkeyword: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SharePoint.Client.Search, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.</Message>
<Timestamp>2019-06-21T05:58:59.2544432Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault i:nil="true" />
<OriginalException i:nil="true" />
<TraceText>

[Sharepoint_searchkeyword: Sharepoint_searchkeyword.searchkeyword]
[a1ff1324-e893-e911-a825-000d3a47c8cb: Sharepoint_searchkeyword.searchkeyword: Update of lvt_searchprofiles]


</TraceText>
</OrganizationServiceFault>

*This post is locked for comments

  • Suggested answer
    _Lars_ Profile Picture
    _Lars_ 225 on at
    RE: I am trying to write a plugin which has to search through files in sharepoint and return path. For I need to use assembly -- "'Microsoft.SharePoint.Client.Search, Version=16.1.0.0," But error says,above assembly could not be loaded.

    I don't think you can use any external libraries with plugins. You can use ILMerge and merge them in but you loose Microsoft support as they are not going to touch your solution if you have used ILMerge by my experience.

    Another approach is to create a HTTPS service that can offload the logic. We use Azure Functions and establish a secure connection where the Azure Function query the external resource with the external library.

    Hope this helps.

  • Suggested answer
    Guido Preite Profile Picture
    Guido Preite 54,073 Moderator on at
    RE: I am trying to write a plugin which has to search through files in sharepoint and return path. For I need to use assembly -- "'Microsoft.SharePoint.Client.Search, Version=16.1.0.0," But error says,above assembly could not be loaded.

    if it is an online instance (meaning you can only register the assembly in sandbox) the alternatives are two:

    1) try to merge the assemblies with ILMERGE (there are guides to do this for dynamics plugins as you need to keep consistent the signing)

    2) create a public reachable webservice to perform the action and inside your plugin you call the webservice and return the results

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,489 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans