web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Invalid Operation Exception RetailSDK Extensions

(0) ShareShare
ReportReport
Posted on by

Hey, i'm new in retail and trying to use RetailSDK for extension on Customer Search Sample. but i keeping getting this error.

in Microsoft.Dynamics.Commerce.Runtime.dll

Additional information: The specified type 'Contoso.Commerce.Runtime.CustomerSearchSample.CustomerSearchRequestHandler, Contoso.Commerce.Runtime.CustomerSearchSample' could not be loaded.


Here are the steps i performed:

1. Added these to the commerceruntime.ext.config
<add source="type" value="Contoso.Commerce.Runtime.CustomerSearchSample.CustomerSearchRequestHandler, Contoso.Commerce.Runtime.CustomerSearchSample" />

2. Uncommented the SDKSAMPLE_CUSTOMERSEARCH section in Program.cs.

3. Run CRT test host project (Runtime.Extensions.TestHost.csproj) in debugger and execute the code.

Help would be appreciated.



I have the same question (0)
  • Ramune Profile Picture
    Microsoft Employee on at

    Hi Faisal,

    I leave this question for community to respond. If I find any useful information, I will respond to you to later.

  • Verified answer
    ahgamal Profile Picture
    Microsoft Employee on at

    Hi Faisal,

    This error as the Customer Search Sample Didn’t actually contain  “CustomerSearchRequestHandler" Which you are trying to adding throw extension.

    you can add new request handle class with name “CustomerSearchRequestHandler" in customer search sample and

    Extend  to handle the “CustomersSearchRequest, customerSearchResponse “ .

    Sample code

    public sealed class CustomerSearchRequestHandler : SingleRequestHandler<CustomersSearchRequest, CustomersSearchResponse>

           {            

               protected override CustomersSearchResponse Process(CustomersSearchRequest request)

               {

                   ThrowIf.Null(request, "request");

                   // Execute the original customer search logic here.              

                   var getCustomerSearchResultsDataRequest = new CustomersSearchServiceRequest(request.Criteria, request.QueryResultSettings);

                   var getCustomerSearchResultsDataResponse = this.Context.Execute<CustomersSearchServiceResponse>(getCustomerSearchResultsDataRequest);

                   // Execute the custom customer search new logic here.

                   return new CustomersSearchResponse(getCustomerSearchResultsDataResponse.Customers);

               }            

           }

    Best regards,

    Ahmed Gamal

    Support Engineer / Microsoft Dynamics 365 Commerce

    EMEA Customer Services and Support

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 681

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 448 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 218 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans