10/01/2011

Microsoft Visual Studio 2010 Bug : SharePoint List Definition Project Invalid Schema.xml

Surprised!!!!!

I wanted to simple create a custom list in SharePoint 2010, using Visual Studio 2010.

Stpes :

1. Open Visual Studio 2010

2. Got To File -> New -> Project

3. Select Visual C# (I selected C#, you may select VB.NET) -> SharePoint -> 2010

4. Select Project Type as List Definition

5. Give some name to your project and select OK.

6. Enter your SharePoint site URL to validate and deploy the solution as farm solution, click Next

7. Give some name to your List Definition

8. Select Custom List as type of the List Definition

9. Click on Finish

10. Visual Studio 2010 will list down few of the files (see in solution explorer).

11. Build The Project.

12. You will get below warnings:

Warning 1 The element 'View' in namespace 'http://schemas.microsoft.com/sharepoint/' has invalid child element 'ParameterBindings' in namespace 'http://schemas.microsoft.com/sharepoint/'. List of possible elements expected: 'ViewFooter, GroupByHeader, ViewEmpty, Xsl, PagedRecurrenceRowset, RowLimitExceeded, ViewData, ViewBody, PagedClientCallbackRowset, ViewStyle, ViewHeader, PagedRowset, Method, GroupByFooter' in namespace 'http://schemas.microsoft.com/sharepoint/'. c:\users\xxx\documents\visual studio 2010\Projects\ListDefinitionProject2\ListDefinitionProject2\ListDefinition1\Schema.xml 44 10 ListDefinitionProject2 

Warning 2 The 'Default' attribute is not declared. c:\users\xxx\documents\visual studio 2010\Projects\ListDefinitionProject2\ListDefinitionProject2\ListDefinition1\Schema.xml 54 18 ListDefinitionProject2

Warning 3 The element 'View' in namespace 'http://schemas.microsoft.com/sharepoint/' has invalid child element 'ParameterBindings' in namespace 'http://schemas.microsoft.com/sharepoint/'. List of possible elements expected: 'ViewFooter, ViewFields, GroupByHeader, Query, ViewEmpty, Xsl, PagedRecurrenceRowset, RowLimitExceeded, ViewData, ViewBody, PagedClientCallbackRowset, ViewStyle, ViewHeader, PagedRowset, Method, GroupByFooter' in namespace 'http://schemas.microsoft.com/sharepoint/'. c:\users\xxx\documents\visual studio 2010\Projects\ListDefinitionProject2\ListDefinitionProject2\ListDefinition1\Schema.xml 56 10 ListDefinitionProject2

 Warning 4 The element 'View' in namespace 'http://schemas.microsoft.com/sharepoint/' has invalid child element 'ParameterBindings' in namespace 'http://schemas.microsoft.com/sharepoint/'. List of possible elements expected: 'ViewFooter, ViewFields, GroupByHeader, ViewEmpty, Xsl, PagedRecurrenceRowset, RowLimitExceeded, ViewData, ViewBody, PagedClientCallbackRowset, RowLimit, ViewStyle, ViewHeader, PagedRowset, Method, GroupByFooter' in namespace 'http://schemas.microsoft.com/sharepoint/'. c:\users\xxx\documents\visual studio 2010\Projects\ListDefinitionProject2\ListDefinitionProject2\ListDefinition1\Schema.xml 92 10 ListDefinitionProject2

Below is full Schema.xml file :

<?xml version="1.0" encoding="utf-8"?>
<List xmlns:ows="Microsoft SharePoint" Title="ListDefinitionProject3 - ListDefinition1" FolderCreation="FALSE" Direction="$Resources:Direction;" Url="Lists/ListDefinitionProject3-ListDefinition1" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/">
<MetaData>
<ContentTypes>
<ContentTypeRef ID="0x0104">
<Folder TargetName="Announcement" />
</ContentTypeRef>
<ContentTypeRef ID="0x0120" />
</ContentTypes>
<Fields>
<Field ID="{7662cd2c-f069-4dba-9e35-082cf976e170}" Type="Note" RichText="TRUE" RichTextMode="FullHtml" IsolateStyles="TRUE" NumLines="15" Name="Body" DisplayName="$Resources:core,camlid2;" Sortable="FALSE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Body"></Field>
<Field ID="{6a09e75b-8d17-4698-94a8-371eda1af1ac}" Type="DateTime" Name="Expires" DisplayName="$Resources:core,camlid3;" Format="DateOnly" FromBaseType="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Expires"></Field>
</Fields>
<Views>
<View BaseViewID="0" FreeForm="TRUE" Type="HTML" MobileView="TRUE" TabularView="FALSE">
<Toolbar Type="Standard" />
<XslLink>main.xsl</XslLink>
<Query>
<Where>
<Or>
<IsNull>
<FieldRef Name="Expires" />
</IsNull>
<Geq>
<FieldRef Name="Expires"></FieldRef>
<Value Type="DateTime">
<Today></Today>
</Value>
</Geq>
</Or>
</Where>
<OrderBy>
<FieldRef Name="Modified" Ascending="FALSE"></FieldRef>
</OrderBy>
</Query>
<ViewFields>
<FieldRef Name="LinkTitleNoMenu" Explicit="TRUE"></FieldRef>
<FieldRef Name="Body" Explicit="TRUE"></FieldRef>
<FieldRef Name="Author" Explicit="TRUE"></FieldRef>
<FieldRef Name="Modified" Explicit="TRUE"></FieldRef>
<FieldRef Name="Attachments" Explicit="TRUE"></FieldRef>
</ViewFields>
<RowLimit>5</RowLimit>
<ParameterBindings>
<ParameterBinding Name="NoAnnouncements" Location="Resource(wss,NoAnnouncements)" />
<ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,NoAnnouncementsHowTo)" />
<ParameterBinding Name="AddNewAnnouncement" Location="Resource(wss,idHomePageNewAnnounce)" />
<ParameterBinding Name="MoreAnnouncements" Location="Resource(wss,MoreAnnouncements)" />
<ParameterBinding Name="ByText" Location="Resource(wss,2000)" />
</ParameterBindings>
</View>
<View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,camlid4;" DefaultView="TRUE" MobileView="True" MobileDefaultView="True" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/announce.png" Url="AllItems.aspx">
<Toolbar Type="Standard" />
<XslLink Default="TRUE">main.xsl</XslLink>
<RowLimit Paged="TRUE">30</RowLimit>
<ParameterBindings>
<ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
<ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
</ParameterBindings>
<ViewFields>
<FieldRef Name="Attachments"></FieldRef>
<FieldRef Name="LinkTitle"></FieldRef>
<FieldRef Name="Modified"></FieldRef>
</ViewFields>
<Query>
<OrderBy>
<FieldRef Name="Modified" Ascending="FALSE"></FieldRef>
</OrderBy>
</Query>
</View>
<View BaseViewID="3" FreeForm="TRUE" Type="HTML" TabularView="FALSE">
<Toolbar Type="Standard" />
<XslLink>main.xsl</XslLink>
<Query>
<Where>
<Or>
<IsNull>
<FieldRef Name="Expires" />
</IsNull>
<Geq>
<FieldRef Name="Expires"></FieldRef>
<Value Type="DateTime">
<Today></Today>
</Value>
</Geq>
</Or>
</Where>
<OrderBy>
<FieldRef Name="Modified" Ascending="FALSE"></FieldRef>
</OrderBy>
</Query>
<ParameterBindings>
<ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
<ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
</ParameterBindings>
<ViewFields>
<FieldRef Name="LinkTitleNoMenu" Explicit="TRUE"></FieldRef>
<FieldRef Name="Body" Explicit="TRUE"></FieldRef>
<FieldRef Name="Author" Explicit="TRUE"></FieldRef>
<FieldRef Name="Modified" Explicit="TRUE"></FieldRef>
<FieldRef Name="Attachments" Explicit="TRUE"></FieldRef>
</ViewFields>
<RowLimit>3</RowLimit>
</View>
</Views>
<Forms>
<Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
<Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
<Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
</Forms>
<DefaultDescription>$Resources:onetid10;</DefaultDescription>
</MetaData>
</List>
 
I have submitted this bug at Microsoft -> https://connect.microsoft.com/VisualStudio/feedback/details/692514/microsoft-visual-studio-2010-bug-sharepoint-list-definition-project-invalid-schema-xml
 

2 comments:

  1. Hi Naimish,

    Did you ever find a response to this? I've encountered this on SharePoint 2010 SP1 but haven't yet been able to resolve it. I see Microsoft closed down your ticket without offering a resolution.

    Any pointers are appreciated.

    Cheers,
    Steven

    ReplyDelete
  2. Hi Steven,

    Yes, you are right, Microsoft has closed down my ticket without offering a resolution.

    The only solution I found for this is you just close file from Visual Studio's IDE and the error won't be shown.

    Let me know if you want more clarification.

    Thanks,
    Naimish

    ReplyDelete