14

When I tried to add a SharePoint mvc app I am getting following error:

Error occurred in deployment step 'Install app for SharePoint': 
Failed to install app for SharePoint. Please see the output window for details.

Detailed stack trace:

CorrelationId: 50583239-71cb-4b07-8bcb-4bbc51a22631
     ErrorDetail: There was a problem with activating the app web definition.
     ErrorType: App
     ErrorTypeName: App Related
     ExceptionMessage: Microsoft.SharePoint.SPException: Exception from HRESULT: 0x81070964 ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x81070964
at Microsoft.SharePoint.Library.SPRequestInternalClass.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext)
at Microsoft.SharePoint.Library.SPRequest.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext)
--- End of inner exception stack trace ---
at Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionModules(SPFeaturePropertyCollection props, SPSite site, SPWeb web, SPFeatureActivateFlags activateFlags, Boolean fForce)
at Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionElements(SPFeaturePropertyCollection props, SPWebApplication webapp, SPSite site, SPWeb web, SPFeatureActivateFlags activateFlags, Boolean fForce)
at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, SPFeatureActivateFlags activateFlags, Boolean fForce)
at Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, SPFeatureActivateFlags activateFlags, Boolean force, Boolean fMarkOnly)
at Microsoft.SharePoint.SPFeatureCollection.AddInternalWithName(Guid featureId, Int32 compatibilityLevel, String featureName, Version version, SPFeaturePropertyCollection properties, SPFeatureActivateFlags activateFlags, Boolean force, Boolean fMarkOnly, SPFeatureDefinitionScope featdefScope)
at Microsoft.SharePoint.SPFeatureCollection.AddInternal(Guid featureId, Version version, SPFeaturePropertyCollection properties, Boolean force, Boolean fMarkOnly, SPFeatureDefinitionScope featdefScope)
at Microsoft.SharePoint.SPFeatureCollection.Add(Guid featureId, Boolean force, SPFeatureDefinitionScope featdefScope)
at Microsoft.SharePoint.SPUserSolutionCollection.EnsureWebFeaturesActivated(SPUserSolution solution)
at Microsoft.SharePoint.Packaging.SPUserCodeSolutionDeploymentGroup.ActivateSolution(SPWeb web, SPUserSolution solution)
at Microsoft.SharePoint.Packaging.SPUserCodeSolutionDeploymentGroup.Deploy()
at Microsoft.SharePoint.Administration.SPAppTask.DeployOperation()
at Microsoft.SharePoint.Lifecycle.MonitoredTaskExecution.DoTask()
     Source: AppWeb
     SourceName: App Web Deployment

Can somebody have a light on this issue? :)

Praveen Prasannan
  • 7,093
  • 10
  • 50
  • 70

10 Answers10

21

It is because SharePoint is trying to activate your app as a standard SharePoint feature, when its really an App.

In the features folder of the SharePoint project, there will be a Feature named Feature1.

Open Feature1 and ensure it's contained in the "Items in the solution" list and not in the "Items in the feature" list.

After that you should be able to deploy.

dcarson
  • 2,853
  • 1
  • 25
  • 34
  • 1
    ensure it's contained in the "Items in the solution" >> what does that mean - not very clear – Sandeep Nov 03 '15 at 11:43
  • 1
    When you open the feature, there are two lists displayed in the view that is displayed. One list is titled "Items in the solution", the other list is titled "Items in the feature". – dcarson Nov 05 '15 at 21:44
  • Unfortunately this is not the solution, SharePoint apps deploy in a app web with app-web scoped "features" which are actually just normal features only that they get deployed in that isolated web. If you remove the feature items from the solution then nothing will get installed. (So yes it will work but you'll have no app!) – Martin Laukkanen Apr 05 '16 at 12:21
11

I had the same problem after updateding my NuGet packages. A file called version.json was added and caused this issue. Setting the deployment type to NoDeployment fixed it.

Arjan Hordijk
  • 141
  • 1
  • 5
  • I had this issue when trying to deploy a data .json file. – Alex Angas Apr 27 '14 at 01:42
  • 3
    worth to mention that is blocked on Sharepoint Online http://office.microsoft.com/en-us/office365-sharepoint-online-small-business-help/types-of-files-that-cannot-be-added-to-a-list-or-library-HA101907868.aspx – Hector Sanchez Jun 17 '14 at 15:46
6

In my sharepoint-hosted add-in, I face this issue when have some *.json files(.bower.json, bower.json) inside my sharepoint project folder, after I delete them and run again my app works!

Max He
  • 84
  • 1
  • 3
3

In my case I got this error when I inadvertently changed the TemplateType value in the instance's Elements.xml file .without making the same change in the Element's Definition (the other Elements.xml directly under the Elements root).

Therefore there was a mismatch in the two elements.xml of the list being deployed.

Karthick Kumar
  • 2,349
  • 1
  • 17
  • 30
ranjit
  • 66
  • 3
  • Thank you! Exactly my issue -- I made the change after VS created another feature for me because two of my custom lists had the same default type of 100... i only changed it in one place; didn't know about the other elements! – x0n Nov 20 '15 at 20:34
  • I got this error when I inadvertently delete a instance list – LuisEduardox Jun 08 '19 at 07:41
2

Something similar happened me. I ran JSLint from Visual Studio and it added a .json file which should not be deployed with the app. Setting the deployment type to NoDeployment fixed it.

ptane
  • 21
  • 2
1

I have had the same problem. Problem was that the app.config file of the SharePoint App project has Deployment Type: 'ElementFile' and was going to be deployed to the host web. This should not happen and generated the error.

Solution: Change Deployment Type of the app.config to 'NoDeployment' and redeploy.

0

Have you configured following service applications?

  1. App Management Service Application.
  2. Microsoft SharePoint Foundation Subscription Settings Service Application.

Try configuring following these along with the following

 3. Managed Metadata Service Application.

Refer: http://www.sharepoint-journey.com/app-development-in-sharepoint.html#sthash.00z9jnjB.dpuf

Swati
  • 95
  • 7
0

I saw this error when I forgot to open Visual Studio with "Run as administrator" privileges.

0

Solution

Configure Managed Metadata service application correctly.

Check your domain ip in DNS server.(get your ip from ipconfing from CMD )

Also make sure you have the below service applications configured correctly

  1. App Management Service Application.

  2. Microsoft SharePoint Foundation Subscription Settings Service Application.

Then i looked in to Event Viewer. I found below problem

enter image description here

Then I started the Distributed Cache .

enter image description here

Then i deploy the solution the problem solved. :)

More Details :- http://sharepointstuts.blogspot.com/2015/12/the-content-database-on-server-is.html

MAFAIZ
  • 681
  • 6
  • 13
0

I just changed the hosting type in AppManifest.xml from Provider-hosted to SharePoint-hosted and voilá. I don't know if this was modified by itself when I added an Event Receiver in my project, cause before not fails.

enter image description here

JBarros
  • 101
  • 1
  • 3