2

In my SharePoint 2013 solution (created from visual studio), I created a project that contains all the artifacts form my solution: I put in this project custom fields, custom content types as well as custom lists that my solution requires.

Then I created 3 features in this project :

The first feature which is a site scoped feature contains all the custom content types and custom fields of my solution, its name is Feature_ContentTypes_Fields.

The second feature is a Site Scoped feature and contains all list definitions for my custom lists ( in which I added "Feature_ContentTypes_Fields" as feature activation dependency) , its name is Feature_ListDefinitions.

The last feature which is a web scoped feature manages the creation of all list instances of my custom lists ( in which I added "Feature_ListDefinitions" as feature activation dependency) , its name is Feature_ListInstances.

I can successfully build the solution, but it then fails to deploy.

Here is the output of visual studio while deploying the solution:

------ Deploy started: Project: Model, Configuration: Debug Any CPU ------ Active Deployment Configuration: Default Skipping deployment step because a pre-deployment command is not specified. Recycle IIS Application Pool: Recycling IIS application pool 'SharePoint - 1111'... Retract Solution: Deactivating feature 'Model_Feature_ListDefinitions' ... Deactivating feature 'Model_Feature_ContentTypes_Fields' ... Retracting solution 'model.wsp'... Deleting solution 'model.wsp'... Add Solution:
Adding solution 'Model.wsp'... Deploying solution 'Model.wsp'...
Activate Features: Activating feature 'Feature_ContentTypes_Fields' ... Activating feature 'Feature_ListDefinitions' ... Activating feature 'Feature_ListInstances' ... Error occurred in deployment step 'Activate Features': Cannot complete this action.

Here you find the manifest of the list definitions feature:

<Feature xmlns="http://schemas.microsoft.com/sharepoint/" Title="Model ListDefinitions" Id="ab765f54-0a2b-4aa9-b87c-f5066849dc4a" Scope="Site"> <ActivationDependencies> <ActivationDependency FeatureId="10412a7b-e033-43a0-a485-1c4f4c83ccca" FeatureTitle="Model ContentTypes_Fields" /> </ActivationDependencies> <ElementManifests> <ElementFile Location="CVs\EditDlg.htm" /> <ElementManifest Location="CVs\Elements.xml" /> <ElementFile Location="CVs\FileDlg.htm" /> <ElementFile Location="CVs\Repair.aspx" /> <ElementFile Location="CVs\Schema.xml" /> <ElementFile Location="CVs\Upload.aspx" /> <ElementManifest Location="Notes\Elements.xml" /> <ElementFile Location="Notes\Schema.xml" /> <ElementManifest Location="Activites\Elements.xml" /> <ElementFile Location="Activites\Schema.xml" /> <ElementManifest Location="Demandes RDV\Elements.xml" /> <ElementFile Location="Demandes RDV\Schema.xml" /> <ElementManifest Location="Entretiens\Elements.xml" /> <ElementFile Location="Entretiens\Schema.xml" /> <ElementManifest Location="Formations\Elements.xml" /> <ElementFile Location="Formations\Schema.xml" /> <ElementManifest Location="Idees\Elements.xml" /> <ElementFile Location="Idees\Schema.xml" /> <ElementManifest Location="Mensualites\Elements.xml" /> <ElementFile Location="Mensualites\Schema.xml" /> </ElementManifests> </Feature>

and the manifest of the list instances feature:

<Feature xmlns="http://schemas.microsoft.com/sharepoint/" Title="Model ListInstances" Id="d61d526e-0e16-4bd4-87e1-1479d405e230" Scope="Web"> <ActivationDependencies> <ActivationDependency FeatureId="ab765f54-0a2b-4aa9-b87c-f5066849dc4a" FeatureTitle="Model ListDefinitions" /> </ActivationDependencies> <ElementManifests> <ElementManifest Location="FormationsInstance\Elements.xml" /> <ElementManifest Location="EntretiensInstance\Elements.xml" /> <ElementManifest Location="Demandes RDV Instance\Elements.xml" /> <ElementManifest Location="CVsInstance\Elements.xml" /> <ElementManifest Location="ActivitesInstance\Elements.xml" /> <ElementManifest Location="MensualitesInstance\Elements.xml" /> <ElementManifest Location="NotesInstance\Elements.xml" /> <ElementManifest Location="IdeesInstance\Elements.xml" /> </ElementManifests> </Feature>

Can anyone help me please ?

  • maybe you can try disabling automatic activation of the features, and then do it manually from the UI and check for errors and logs. without seeing the code, that's what I can advise – Tiago Duarte Jul 31 '14 at 12:16
  • thanks for your reply.In fact I disabled the activation of the features while deploying my solution and I activated them from the Sharepoint Site , the activation is successfully achieved for the first two features which are Feature_ContentTypes_Fields and Feature_ListDefinitions , but it didn't work with Feature_ListInstances.( Sorry, something went wrong Cannot complete this action. Please try again.).Any suggestion ? – Rihab BEN CHHIBA Jul 31 '14 at 12:26
  • enable debbugging (web.config), check ULS logs – Tiago Duarte Jul 31 '14 at 12:47
  • @RihabBENCHHIBA when you get the "Sorry, something went wrong Cannot complete this action" there should be also a correlation id. Using that correlation id you can get to the actual error logged in the SharePoint uls system. Also, it would provide useful if you could post the "code" for the third feature. – Hitodama Jul 31 '14 at 12:47
  • In fact the third feature, as I mentioned before, contains list istances of my solution custom lists . – Rihab BEN CHHIBA Jul 31 '14 at 13:13
2

Your list instance must have a FeatureId attribute that maches your ListDefinition's feature.

This is not added by default, so it's likelly that this is why you are getting "Cannot complete this action".

E.g.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <ListInstance Title="ListDef"
                OnQuickLaunch="TRUE"
                TemplateType="10000"
                Url="Lists/ListDef"
                Description="My List Instance" FeatureId="ab765f54-0a2b-4aa9-b87c-f5066849dc4a">
  </ListInstance>
</Elements>
  • Always the same error is displayed. – Rihab BEN CHHIBA Aug 1 '14 at 10:22
  • you can try setting both features to the same scope, but I have just tested this locally and as long as the list instance contains the FeatureId of the Feature where the list definition belongs to, it should work – Tiago Duarte Aug 1 '14 at 10:26
  • similar post: sharepoint.stackexchange.com/questions/39839/… – Tiago Duarte Aug 1 '14 at 10:27
  • when I try to activate the list instance from my site , an error page is displayed : Runtime Error In order to enable the details of this specific error message to be viewable on the local server machine, the "mode" attribute of <customErrors> tag within "web.config" configuration file must be "RemoteOnly" but when I try to overwrite the web.config file , I can't save it (save failed : please check if this file is opened in another program) or it is not the case. – Rihab BEN CHHIBA Aug 1 '14 at 11:00
  • you can stop iis, make a backup of webconfig, and change it. also, close your visual studio. it may be locking down the file as well – Tiago Duarte Aug 1 '14 at 11:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.