sharepoint 2013 - Not able to add columns to Document Library from Visual Studio template -
i trying create new document library sharepoint project template visual studio 2015.
while doing able create document library template , instance. if deploy solution 1 of site creates list well. strange thing if add column template , deploy creates list not create new custom column.
below schema file template.
<?xml version="1.0" encoding="utf-8"?> <list xmlns:ows="microsoft sharepoint" title="shareddocuments" direction="$resources:direction;" url="shareddocuments" basetype="1" xmlns="http://schemas.microsoft.com/sharepoint/" enablecontenttypes="true"> <metadata> <contenttypes> <contenttype id="0x0101000dba2955561e4de0a115152637e9f8e2" name="listfieldscontenttype"> <fieldrefs> <fieldref id="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" name="title" /> <fieldref id="{4b1bf6c6-4f39-45ac-acd5-16fe7a214e5e}" name="templateurl" /> <fieldref id="{cd1ecb9f-dd4e-4f29-ab9e-e9ff40048d64}" name="xd_progid" /> <fieldref id="{fbf29b2d-cae5-49aa-8e0a-29955b540122}" name="xd_signature" /> <fieldref id="{e52012a0-51eb-4c0c-8dfb-9b8a0ebedcb6}" name="combine" /> <fieldref id="{5d36727b-bcb2-47d2-a231-1f0bc63b7439}" name="repairdocument" /> <fieldref id="{8f838bdc-4b95-4b26-b86f-3025d2df964f}" name="testcolumn" /> </fieldrefs> </contenttype> <contenttyperef id="0x0101"> <folder targetname="forms/document" /> </contenttyperef> <contenttyperef id="0x0120" /> </contenttypes> <fields> <field id="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" type="text" name="title" showinnewform="false" showinfiledlg="false" displayname="$resources:core,title;" sealed="true" sourceid="http://schemas.microsoft.com/sharepoint/v3" staticname="title"></field> <field id="{4b1bf6c6-4f39-45ac-acd5-16fe7a214e5e}" type="text" name="templateurl" displaceonupgrade="true" displayname="$resources:core,template_link;" xname="templateurl" filterable="true" sortable="true" hidden="true" frombasetype="true" pitarget="mso-infopathsolution" piattribute="href" sourceid="http://schemas.microsoft.com/sharepoint/v3" staticname="templateurl"></field> <field id="{cd1ecb9f-dd4e-4f29-ab9e-e9ff40048d64}" type="text" name="xd_progid" displaceonupgrade="true" displayname="$resources:core,html_file_link;" xname="progid" filterable="true" sortable="true" hidden="true" frombasetype="true" sourceid="http://schemas.microsoft.com/sharepoint/v3" staticname="xd_progid"></field> <field id="{fbf29b2d-cae5-49aa-8e0a-29955b540122}" type="boolean" group="_hidden" name="xd_signature" displaceonupgrade="true" sourceid="http://schemas.microsoft.com/sharepoint/v3" staticname="xd_signature" displayname="$resources:core,xml_signed;" xname="{fbf29b2d-cae5-49aa-8e0a-29955b540122}" filterable="true" sortable="true" sealed="true" hidden="true" frombasetype="true" readonly="true"></field> <field id="{e52012a0-51eb-4c0c-8dfb-9b8a0ebedcb6}" readonly="true" type="computed" name="combine" displaceonupgrade="true" displayname="$resources:core,merge;" filterable="false" sortable="false" hidden="true" sourceid="http://schemas.microsoft.com/sharepoint/v3" staticname="combine"> <fieldrefs> <fieldref name="fsobjtype" key="primary" /> <fieldref name="encodedabsurl" /> <fieldref name="templateurl" /> </fieldrefs> </field> <field id="{5d36727b-bcb2-47d2-a231-1f0bc63b7439}" readonly="true" type="computed" name="repairdocument" displaceonupgrade="true" displayname="$resources:core,relink;" filterable="false" sortable="false" hidden="true" sourceid="http://schemas.microsoft.com/sharepoint/v3" staticname="repairdocument"> <fieldrefs> <fieldref name="fsobjtype" key="primary" /> <fieldref name="id" /> </fieldrefs> </field> <field name="testcolumn" id="{8f838bdc-4b95-4b26-b86f-3025d2df964f}" displayname="testcolumn" type="text" /> </fields> <views> --removed-- </views> <forms> <form type="displayform" setuppath="pages\form.aspx" url="forms/dispform.aspx" webpartzoneid="main" /> <form type="editform" setuppath="pages\form.aspx" url="forms/editform.aspx" webpartzoneid="main" /> <form type="newform" url="forms/upload.aspx" webpartzoneid="main" /> --removed-- </forms> </metadata> </list>
when upload document in document library there's option choose content type, choose custom content type , you'll see fields defined.