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? :)
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.
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.
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!
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.
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.
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.
Have you configured following service applications?
- App Management Service Application.
- 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
I saw this error when I forgot to open Visual Studio with "Run as administrator" privileges.
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
App Management Service Application.
Microsoft SharePoint Foundation Subscription Settings Service Application.
Then i looked in to Event Viewer. I found below problem
Then I started the Distributed Cache .
Then i deploy the solution the problem solved. :)
More Details :- http://sharepointstuts.blogspot.com/2015/12/the-content-database-on-server-is.html
来源:https://stackoverflow.com/questions/20349662/sharepoint-app-deployment-error-failed-to-install-app-for-sharepoint