SharePoint: Incompatible Web Part markup detected. Use *.dwp Web Part XML instead of *.webpart Web Part XML

Scenario:

We deployed a webpart and when tried it to add it on the page, following error occurred:

Incompatible Web Part markup detected. Use *.dwp Web Part XML instead of *.webpart Web Part XML.

Resolution:

This error occurs when you have not inherited your class from “System.Web.UI.WebControls.WebParts.WebPart”. We have inheritated our class from “Microsoft.Office.Server.WebAnalytics.Reporting.WhatsPopularWebPart” class as we were customizing OOTB “WhatsPopularWebPart”. The resolution is to create your own “.dwp” file. Copy pate following XML, make appropriate changes and save it with “.dwp” extension.

<?xml version=”1.0″?>

<WebPart xmlns=”http://schemas.microsoft.com/WebPart/v2″&gt;

<Assembly>[AssemblyName],Version=[X.X.X.X], Culture=[XXXXX],PublicKeyToken=[XXXXXXXX]</Assembly>

<TypeName>WebPartNamespace.WebPartClassName</TypeName>

<Title>WebPartTitle</Title>

<Description>WebPartDescription</Description>

</WebPart>

One quick way is to open “.webpart” file and replace values.

Second step is to go to 14 hives or 12 hives [C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES], found the feature folder. Delete “.webpart” file and paste “.dwp” file. Repeat the same process in the SharePoint installation. Go to Site Collection Settings-> Web parts (under Galleries). Delete “.webpart” file and upload “.dwp” file.

Source:

http://blog.sharepointdevelopment.nl/post/Unable-to-add-selected-Web-Part-Incompatible-Web-Part-markup-detected.aspx

Advertisements

2 Comments »

  1. Raj said

    Hey,

    I have the following in my .webpart file. how do I chnage it.

    $Resources:core,ImportErrorMessage;

    InheritedWebpart
    My Visual WebPart

    • Raj said

      $Resources:core,ImportErrorMessage;

      InheritedWebpart
      My Visual WebPart

RSS feed for comments on this post · TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: