This SharePoint tutorial explains, how to fix an error that comes when we were trying to create a SharePoint list from a custom list template using (c#.net) .net managed object model code. The error comes as ListCreationInformation does not contain a definition for ListTemplate and no extension method ListTemplate accepting a first argument of type ListCreationInformation could be found.
But we got the below error in the below line:
listCreationInfo.ListTemplate = listTemplate;
The error comes as:
‘ListCreationInformation’ does not contain a definition for ‘ListTemplate’ and no extension method ‘ListTemplate’ accepting a first argument of type ‘ListCreationInformation’ could be found (are you missing a using directive or an assembly reference?)
The solution is to use the updated dll (Microsoft.SharePoint.Client.dll).
Here I have used the 16.1.6420.1200 version of Microsoft.SharePoint.Client.dll.
You may like following SharePoint tutorials:
- Sorry, something went wrong. Sorry, this site can’t be saved as a template. It contains apps that don’t work in templates
- Unexpected error occurred in method GetObject usage Distributed Logon Token Cache SharePoint 2013 error
- restore-spsite directorynotfoundexception SharePoint 2013
- The type or namespace name SharePoint does not exist in the namespace Microsoft error in SharePoint 2013
- SharePoint 2013/2016/Online: CSOM vs JSOM vs SSOM vs REST
- How to get office 365 tenant id for sharepoint online site?
- How to Configure hybrid OneDrive and Sites features in SharePoint 2016?
- Everything is fine but we had a small problem getting your license SharePoint 2016 App Error
- We’re sorry Microsoft Office installer encountered a problem because you have there click to run installer based office programs installed on your computer
- A different version of this App is already installed with the same version number
- [Video Tutorial] SharePoint Online List Feature
- System.ArgumentException: The Ribbon Tab with id: Ribbon.Read has not been made available for this page or does not exist
- Windows Server roles and features cannot be automatically installed or uninstalled via the Windows Features Control Panel while installing .Net framework 3.5
- Safe mode did not start successfully. Microsoft.SharePoint.WebPartPages.WebPartPageUserException: SafeControl expected
Here, we learned how to fix the error, ListCreationInformation does not contain a definition for ListTemplate error.
Bhawana Rathore is a Microsoft MVP (3 times in Office Apps & Services) and a passionate SharePoint Consultant, having around 10 years of IT experience in the industry, as well as in .Net technologies. She likes to share her technical expertise in EnjoySharePoint.com and SPGuides.com
Download SharePoint Online Tutorial PDF FREE!
Get update on Webinars, video tutorials, training courses etc.