SharePoint应用程序部署错误:“无法安装SharePoint应用程序”

时间:2013-12-03 11:17:25

标签: sharepoint deployment sharepoint-2013 sharepoint-apps

当我尝试添加SharePoint mvc应用时,我收到以下错误:

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

详细的堆栈跟踪:

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

有人可以了解这个问题吗? :)

9 个答案:

答案 0 :(得分:21)

这是因为SharePoint正在尝试将您的应用程序激活为标准SharePoint功能,当它真的是一个应用程序时。

在SharePoint项目的features文件夹中,将有一个名为Feature1的功能。

打开Feature1并确保它包含在“解决方案中的项目”列表中,而不是“功能中的项目”列表中。

之后你应该能够部署。

答案 1 :(得分:11)

更新我的NuGet包后,我遇到了同样的问题。添加了一个名为version.json的文件并导致此问题。将部署类型设置为NoDeployment会修复它。

答案 2 :(得分:6)

在我的sharepoint托管的加载项中,我在我的sharepoint项目文件夹中有一些* .json文件(.bower.json,bower.json)时遇到此问题,在我删除它们并再次运行后我的应用程序正常工作!

答案 3 :(得分:3)

在我的情况下,当我无意中更改了实例的Elements.xml文件中的TemplateType值时,我收到了此错误。没有在Element的定义中进行相同的更改(另一个{{1直接在Elements根目录下)。

因此,正在部署的列表的Elements.xml中存在不匹配。

答案 4 :(得分:2)

类似的事情发生在我身上。我从Visual Studio运行JSLint,它添加了一个不应该与应用程序一起部署的.json文件。将部署类型设置为NoDeployment会修复它。

答案 5 :(得分:1)

我遇到了同样的问题。问题是SharePoint App项目的app.config文件具有部署类型:'ElementFile',并且将部署到主机Web。 这不应该发生并产生错误。

<强>解决方案: 将app.config的部署类型更改为“NoDeployment”并重新部署。

答案 6 :(得分:0)

您是否配置了以下服务应用程序?

  1. 应用管理服务应用程序。
  2. Microsoft SharePoint Foundation订阅设置服务应用程序。
  3. 尝试按照以下这些配置进行配置

     3. Managed Metadata Service Application.
    

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

答案 7 :(得分:0)

解决方案

正确配置Managed Metadata Service应用程序。

在DNS服务器中检查你的域名ip。(从CMD的ipconfing获取你的ip)

还要确保正确配置以下服务应用

  1. 应用管理服务应用程序。

  2. Microsoft SharePoint Foundation订阅设置服务应用程序。

  3. 然后我查看了事件查看器。我发现了以下问题

    enter image description here

    然后我启动了分布式缓存。

    enter image description here

    然后我部署了解决问题的解决方案。 :)

    更多详情: - http://sharepointstuts.blogspot.com/2015/12/the-content-database-on-server-is.html

答案 8 :(得分:0)

我刚刚将AppManifest.xml中的托管类型从“提供者托管”更改为“ SharePoint托管”。我不知道在我向项目中添加事件接收器时是否对其进行了修改,因为它不会失败。

enter image description here