Roland Oldengarm - Independent IT Contractor

Living in the coolest little capital Wellington, New Zealand!

Cannot recognize the XML namespace of this Web Part

When provisioning pages (e.g. default.aspx) using a feature, you can add default webparts using <AllUsersWebPart>

Keep in mind you have two types of webparts, v2 en v3. When provisioning v2: you should use the following syntax:

<AllUsersWebPart WebPartZoneID="FooterLeft" WebPartOrder="2">                
<![CDATA[                             
<WebPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/WebPart/v2">                  
...
</WebPart>                
]]>            
</AllUsersWebPart>

and with v3:

<AllUsersWebPart WebPartZoneID="FooterLeft" WebPartOrder="5">                
<![CDATA[                    
<webParts>                      
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">   ... 
</webPart>                    
</webParts>                
]]>            
</AllUsersWebPart>

Look at the difference in attributes of WebPart-tag AND the extra <webParts> tag in the v3-version. If you add <webParts> around the <webPart>-declaration in the v2-version, you could receive the error: Cannot recognize the XML namespace of this Web Part. That is the reason for the title of this post 🙂

13 Comments

  1. Cool man.. that helped!

  2. Thank you.

  3. Please increase the font size of the following :D. I was walking all over the place without noticing this important part.

    “Look at the difference in attributes of WebPart-tag AND the extra tag in the v3-version. If you add around the -declaration in the v2-version, you could receive the error: Cannot recognize the XML namespace of this Web Part. “

  4. Also Thanks a lot. It saved lot of time.

  5. Thanks for posting, it saved my time 🙂

  6. Exactly what I needed… thanks!

  7. I was trying to add a ImageWebpart to a pagelayout in sharepoint 2013, which was giving out error. Tried everything and did not find what was happening. At that point I came across your post and it saved me. Thanks

  8. It really helped.. Many thanks 😀

  9. That did it, thanks!!!!

  10. “If you add around the -declaration in the v2-version, you could receive the error: Cannot recognize the XML namespace of this Web Part. That is the reason for the title of this post.”

    The reverse is also true; if you miss the around the -declaration in the v3-version you receive the same error. That is the reason for my visit! (You also get it if you capitalise the W in )

    Thanks for the help.

Leave a Reply

Your email address will not be published.

*