I'm trying to provisioning a content search web part. I've made a site feature and a standard web part (xml and webpart file).

enter image description here

When I activate the feature I get the web part but it's not a Content by search web part, it's just a normal one. See picture below

enter image description here

How do I turn the normal web part into a CSWP? Link?

1 Answer 1

<?xml version="1.0" encoding="utf-8"?>
  <webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
      <type name="Microsoft.Office.Server.Search.WebControls.ContentBySearchWebPart, Microsoft.Office.Server.Search, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
      <importErrorMessage>Cannot import this Web Part.</importErrorMessage>

I had wrong "type name" .. be sure to have right type name.

Export a cswp and just paste it into the webpart file. Remember to have the

<?xml version="1.0" encoding="utf-8"?>

on top!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.