VSeWSS error - the response message does not match the content type
I got the following error trying to build a project of the WSS extensions for Visual Studio 1.3
You can fix it by: Add / Remove Programs and add HTTP Activation. Here's the step by step: Use Turn Windows Features On and Off in the control panel, then locate .NET Framework 3.5 and then find Windows Communication Foundation HTTP Activation. Select it and choose.
Ten Themes for SharePoint in VSeWSS Projects
Microsoft released a set of ten Visual Studio 2008 extensions for SharePoint projects containing designed themes for SharePoint.
You can download them here: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=0a87658f-20b8-4dcc-ad7a-09ad22641f3a
Update 21-3-2009:
Daniel Brown has a downloadable package on his website to install a single wsp (with each theme as a feature). You can download it from: http://www.danielbrown.id.au/Lists/Posts/Post.aspx?ID=256
WSS Extensions 1.3 for Visual Studio 2008 CTP
On the Microsoft SharePoint Team Blog you can read about the CTP release of version 1.3 of Windows Sharepoint Services 3.0 extenisions for Visual Studio 2008 (VSeWSS).
The new features in VSeWSS 1.3 are:
· Can be installed on x64 Server OS machines running SharePoint x64. Previously only x86 Server OS could be used.
· Separate build commands for package, deploy and retract are added
· Command line build, package and retract commands are included enabling continuous integration and build servers. Previously command line build of SharePoint projects was very difficult
· Refactoring support for renaming of Web Parts. Previously renaming a web part required changes in several files in the project
· WSP View improvements for consistency of deleting feature elements, merging features and adding event receivers to features
· Solution Generator can now generate solutions from publishing sites. Previously only regular sites could be generated
· Allowing partial trust BIN deployments of web parts. CAS configuration must still be provided by the developer.
· New project item template for SharePoint RootFiles items
· Deployment will now optionally remove conflicting existing features on the development server prior to redeployment. Previously any feature name conflicts would result in an error
· Ancillary assemblies such as for business logic can now be added to the SharePoint Solution WSP
· Hidden features related to Site Definition projects are now shown in WSP View. They are no longer hidden
· For advanced users a fast deploy is included to update only the compiled assembly on the SharePoint development installation
· The User Guide is now installed with the extensions instead of being a separate download
The final release of VSeWSS 1.3 is planned for the North American Spring of 2009.
Download now!
Adding a List - ListFields and Items from code
Often it is required to insert a list, listitem and listitems from code. An
example is creating a list if it not exists from a Feature or WebPart. By
creating a list we out of the box get the Title field. The next code shows the
process of creating a custom list, columns and items from code. It also shows
how you can change to out-of-the-box Title column.
// Option 1) Inside SharePoint
SPSite siteCollection = SPContext.Current.Site;
SPWeb site = SPContext.Current.Web;
// Option 2) From an external tool
SPSite siteCollection = new SPSite("http://myurl");
SPWeb site = siteCollection.RootWeb;
// Get a ListCollection from the current site
SPListCollection lists = site.Lists;
// Add a custom List to the SharePoint site
lists.Add("Employee", "List containing employees", SPListTemplateType.GenericList);
// Put the new list in a variable
SPList employeeList = lists["Employee"];
// Get the out of the box fields (Title, Attachment etc)
SPFieldCollection fields = employeeList.Fields;
// Change the default title column
SPField field = fields["Title"];
field.Title = "Name";
// Don't forget the update to commit changes
field.Update();
// Add a new field
SPField fieldAdd = fields[fields.Add("Address", SPFieldType.Text, true)];
SPView view = employeeList.DefaultView;
SPViewFieldCollection viewFields = view.ViewFields;
// Add the field to the defaultview (all items)
viewFields.Add(fieldAdd);
view.Update();
// Add a record to the new list
SPListItem item = employeeList.Items.Add();
item["Name"] = "Name of the Employee";
item["Address"] = "Address of the employee";
item.Update();
[/code]
Unable to add selected Web Part - Incompatible Web Part markup detected
During developing a custom toolpart using WSS extensions for Visual Studio 2005
I got the following error by adding my webpart to the webpart page:
"Incompatible Web Part markup detected. Use *.dwp web part XML instead of
*.webpart web part xml". By overriding the GetToolParts() method we have to
derive or Web Part class from the Microsoft.SharePoint.WebPartPages.WebPart
class. A Web Part derived from this class expects a .dwp file. But the
solutionpackage (.wsp) created by the WSS Extensions creates a .webpart-file. We
can simply solve this error by making a custom .dwp file:
<?xml version="1.0"?>
<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
<Assembly>AssemblyName(with no .dll extension),
Version=VersionNumber, Culture=Culture,
PublicKeyToken=PublicKeyToken</Assembly>
<TypeName>WebPartNamespace.WebPartClassName</TypeName>
<Title>DefaultWebPartTitle</Title>
<Description>WebPartDescription</Description>
</WebPart>
Delete your .webpart file from you Feature directory in the 12-hyve and place here your new .dwp file. Go to Site Settings --> Web Parts (= Web Part Gallery) and delete your Web Part (which currently reffers to a .webpart file). Upload your new .dwp file. Now you can add your Web Part to your Web Part page!