C# – Error when trying to deploy web part

csharepointweb-parts

I just wrote a new web part and now I am getting this error when I try to deploy them on my non-dev servers:

the default namespace
'http://schemas.microsoft.com/WebPart/v2'
is a reserved namespace for base Web
Part propertiees. Custom Web Part
properties require a unique namespace
(specified through an
XmlElementAttribute on the property ,
or an XmlRootAttribute on the class).

I am writing the web parts into CAB files and deploying them with this:

stsadm -o addwppack -filename web_part_name.CAB -url http://your_url_here -globalinstall -force 

Everything works fine until I try to add the web part, then I get this error in a popup. It works just fine on my dev VM…?

Any ideas would be appreciate, thank you.

Best Answer

Well, it looks like your webpart definition file si somehow broken. The wey i do it is to put webpart into page and then export it. You can do this just by opening webpart galery, which can be located in site settings of root site collection and add your webpart there.

After that just place webpart to any page and use export button in webpart settings. This will produce .webpart or .dwp file depending on your webpart (.webpart is 'new' definition which is used by webparts native to MOSS 2007 and .dwp is for older webparts, but it depends how you have written your webpart)

Then just take exported file and include it into your project. This approach works for me at least.