Exception: [COMException (0x81072101): <nativehr>0x81072101</nativehr><nativestack> </nativestack> Cannot complete this action.

1 minute read

When I was working on a project I had to create a list instance of one of our own list definitions. I created a feature with the following element.xml.

<xml version="1.0" encoding="utf-8">
<elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <listinstance title="Public Navigation"
                  description="Public Navigation List"
                  url="Lists/NavigationPublic"
                  templatetype="15555">
    </listinstance>
</elements>

When I activate this feature I got the following exception: [COMException (0x81072101): 0x81072101Cannot complete this action.

Native Error

When I looked into the log files of SharePoint I found the following entries:

 09/20/2010 16:11:43.49 w3wp.exe (0x1ED8) 0x1AB4 SharePoint Foundation Fields 88yt High GetUserListSchema(): Failed to get the list schema XML for feature '41202ea8-d927-475f-b710-48fe3af7e403', template '15555': hr=0x81072101. eee79fed-2362-41c1-aaa2-29b93ddee0ca

09/20/2010 16:11:43.49 w3wp.exe (0x1ED8) 0x1AB4 SharePoint Foundation General 8l2r High Failed to find the list schema for FeatureId '41202ea8-d927-475f-b710-48fe3af7e403', list template ID 15555. Cannot create list in web "http://sharepoint/sites/Test" at URL "Lists/NavigationTop". eee79fed-2362-41c1-aaa2-29b93ddee0ca 09/20/2010 16:11:43.49 w3wp.exe (0x1ED8) 0x1AB4 SharePoint Foundation General 8kh7 High 0x81072101Cannot complete this action. Please try again. eee79fed-2362-41c1-aaa2-29b93ddee0ca

This looked to me like the feature could not find the schema.xml that was defined for the list definition. I then went looking through the list instance definition and found out that I can insert a feature ID attribute. Point this feature ID attribute to the feature that installs the schema.xml and everything will go just fine.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <ListInstance Title="Public Navigation"
                TemplateType="15555"
                FeatureId="aba8f789-1478-4ac7-ad36-95fceb12a23c"
                Url="Lists/NavigationPublic"
                Description="Public Navigation List" />
</Elements>