I created a vs solution with
- site columns
- content type
- list template
- list instance.
It compiles, it installs correctly, except when I click on activate I got the exception on the ULS logs:
System.ArgumentNullException: Key cannot be null. Parameter name: key on feature activation
Site Columns
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Field ID="{204D9564-56ED-4D71-BB36-BCBA4B316337}" Name="ExternalSiteUrl"
DisplayName="ExternalSiteUrl" Type="Text" Group="Mirage Teams Columns"
Required="TRUE"></Field>
<Field ID="{AFBCD50B-6C45-4B64-9589-194B5133978C}" Name="ExternalSiteDescription"
DisplayName="ExternalSiteDescription" Type="Text" Group="Mirage Teams Columns"
MaxLength="255" Required="TRUE"></Field>
</Elements>
Content type:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Parent ContentType: Item (0x01) -->
<ContentType ID="0x01003098bdc2a2534bae9c08f5701ea4f89f"
Name="CTExternalSites"
Group="Mirage Teams Content Types"
Description="Content Type for External Sites"
Inherits="TRUE"
Version="0">
<FieldRefs>
<FieldRef ID="{204D9564-56ED-4D71-BB36-BCBA4B316337}" Name="ExternalSiteUrl"></FieldRef>
<FieldRef ID="{AFBCD50B-6C45-4B64-9589-194B5133978C}" Name="ExternalSiteDescription"></FieldRef>
</FieldRefs>
</ContentType>
</Elements>
List Template
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Do not change the value of the Name attribute below. If it does not match the folder name of the List Definition project item, an error will occur when the project is run. -->
<ListTemplate
Name="ListExternalSites"
Type="10000"
BaseType="0"
OnQuickLaunch="TRUE"
SecurityBits="11"
Sequence="410"
DisplayName="External Sites"
Description="External Sites List Template"
Image="/_layouts/images/itgen.png"/>
</Elements>
List Instance
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ListInstance Title="SlnMirageTeamsCustomization - ListInstanceExternalSites"
OnQuickLaunch="TRUE"
TemplateType="10000"
Url="Lists/ExternalSites"
Description="External Sites">
</ListInstance>
</Elements>
Schema.xml
<List xmlns:ows="Microsoft SharePoint" Title="External Sites" FolderCreation="FALSE" Direction="$Resources:Direction;" Url="Lists/SlnMirageTeamsCustomization-ListExternalSites" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/">
<MetaData>
<ContentTypes>
<ContentType ID="0x01003098bdc2a2534bae9c08f5701ea4f89f" Name="CTExternalSites" Group="Mirage Teams Content Types" Description="Content Type for External Sites" Inherits="TRUE" Version="0">
<FieldRefs>
<FieldRef ID="{204D9564-56ED-4D71-BB36-BCBA4B316337}" Name="ExternalSiteUrl"></FieldRef>
<FieldRef ID="{AFBCD50B-6C45-4B64-9589-194B5133978C}" Name="ExternalSiteDescription"></FieldRef>
</FieldRefs>
</ContentType>
</ContentTypes>
<Fields>
<Field ID="{204d9564-56ed-4d71-bb36-bcba4b316337}" Name="ExternalSiteUrl" DisplayName="ExternalSiteUrl" Type="Text" Group="Mirage Teams Columns" Required="TRUE">
</Field>
<Field ID="{afbcd50b-6c45-4b64-9589-194b5133978c}" Name="ExternalSiteDescription" DisplayName="ExternalSiteDescription" Type="Text" Group="Mirage Teams Columns" MaxLength="255" Required="TRUE">
</Field>
</Fields>
<Views>
<View BaseViewID="0" Type="HTML" MobileView="TRUE" TabularView="FALSE">
<Toolbar Type="Standard" />
<XslLink Default="TRUE">main.xsl</XslLink>
<RowLimit Paged="TRUE">30</RowLimit>
<ViewFields>
<FieldRef Name="LinkTitleNoMenu">
</FieldRef>
</ViewFields>
<Query>
<OrderBy>
<FieldRef Name="Modified" Ascending="FALSE">
</FieldRef>
</OrderBy>
</Query>
<ParameterBindings>
<ParameterBinding Name="AddNewAnnouncement" Location="Resource(wss,addnewitem)" />
<ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
<ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_ONET_HOME)" />
</ParameterBindings>
</View>
<View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx">
<Toolbar Type="Standard" />
<XslLink Default="TRUE">main.xsl</XslLink>
<RowLimit Paged="TRUE">30</RowLimit>
<ViewFields>
<FieldRef Name="LinkTitleNoMenu"></FieldRef>
<FieldRef Name="ExternalSiteUrl"></FieldRef>
<FieldRef Name="ExternalSiteDescription"></FieldRef>
<!--<FieldRef Name="Attachments">
</FieldRef>
<FieldRef Name="LinkTitle">
</FieldRef>-->
</ViewFields>
<Query>
<OrderBy>
<FieldRef Name="ID">
</FieldRef>
</OrderBy>
</Query>
<ParameterBindings>
<ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
<ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
</ParameterBindings>
</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>
</MetaData>
</List>
I am using the following to install
Add-SPSolution -LiteralPath "D:\27022012\SlnMirageTeamsCustomization\SlnMirageTeamsCustomization\bin\Debug\SlnMirageTeamsCustomization.wsp"
Install-SPSolution –Identity SlnMirageTeamsCustomization.wsp -GACDeployment -Force
# Install-SPFeature use it only after installing or upgrading the solution
Install-SPFeature "SlnMirageTeamsCustomization_FeatureExternalSites" -force
Enable-SPFeature "SlnMirageTeamsCustomization_FeatureExternalSites" -Url http://xxx/