Travis Smith

Serving. Teaching. Leading. Innovating.

  • Home
  • About
  • Leadership
  • Development
  • Contact
  • CV
  • Tools
    • JavaScript Object Playground

June 11, 2015 by Travis Smith Leave a Comment

SharePoint Online: Deployment Error ‘Install App for SharePoint’ Failed

SharePoint Online: Deployment Error ‘Install App for SharePoint’ Failed

When deploying a SharePoint app in SharePoint Online, you may receive the “all too helpful” error message:

Error occurred in deployment step ‘Install App for SharePoint’: Failed to install App for SharePoint. Please see the output window for details.

Visual Studio 2013 Deployment Error Prompt

If you force the installation to continue, you will most likely see a Correlation ID error page.
SharePoint Online: Sorry, something went wrong with Correlation ID

Then if you look at the Build Log within Visual Studio, you see another set of “all too helpful” information that may or may not be:

------ Build started: Project: Submittals, Configuration: Debug Any CPU ------
------ Deploy started: Project: Submittals, Configuration: Debug Any CPU ------
Active Deployment Configuration: Deploy App for SharePoint
Skipping deployment step because a pre-deployment command is not specified.
Skipping the uninstall step because the app for SharePoint is not installed on the server.
Install app for SharePoint:
Uploading the app for SharePoint...
Installation is in progress (00:00:01)
Installation is in progress (00:00:03)
Installation is in progress (00:00:05)
Installation is in progress (00:00:07)
Installation is in progress (00:00:09)
Installation is in progress (00:00:12)
Installation is in progress (00:00:14)
Installation is in progress (00:00:16)
Installation is in progress (00:00:18)
Installation is in progress (00:00:20)
Installation is in progress (00:00:22)
Installation is in progress (00:00:25)
Installation is in progress (00:00:27)
Installation is in progress (00:00:29)
Installation is in progress (00:00:31)
Installation is in progress (00:00:33)
Installation is in progress (00:00:35)
Installation is in progress (00:00:37)
App failed to install, cleaning up...
Successfully uninstalled the app for SharePoint.
App installation encountered the following errors:
6/11/2015 2:22:50 PM
@"Error 1
CorrelationId: 6d55b159-5882-42cf-8f82-44921326da68
ErrorDetail: There was a problem with activating the app web definition.
ErrorType: App
ErrorTypeName: App Related
ExceptionMessage: Dependency feature 'SOLUTIONName_Feature1' (id: 73a9d39a-4fbd-4c59-89a3-875b6e1d1560) for feature 'SOLUTIONName_Feature2' (id: 55662431-dea2-426b-80ca-838e85904460) is not activated at this scope.
Source: AppWeb
SourceName: App Web Deployment
Error occurred in deployment step 'Install app for SharePoint': Failed to install app for SharePoint. Please see the output window for details.
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
00:00.387 - Failed - Debug Any CPU - SOLUTIONFolder\SOLUTIONName.csproj
Total build time: 00:00.000
========== : 0 succeeded or up-to-date, 1 failed, 0 skipped, Completed at 6/11/2015 10:22:50 AM ==========
view raw visual-studio-debug-output.log hosted with ❤ by GitHub

So what is the issue? Here are the possible issues (in no particular order):

  1. You may have another app deployed and in debug mode within Visual Studio. This happened to me once when I was trying to compare two apps from two clients. I thought I was working within the new app; however, I accidentally deployed the older other client app and left it running.
    SOLUTION: Stopping debug via Visual Studio DEBUG > Stop Debugging.
  2. You have files that are trying to be deployed and are no longer found within your solution. To check this, look at all of your SharePointProjectItem.spdata files (a XML file). It will look something like this:
    <?xml version="1.0" encoding="utf-8"?>
    <ProjectItem Type="Microsoft.VisualStudio.SharePoint.Module" DefaultFile="Elements.xml" SupportedTrustLevels="All" SupportedDeploymentScopes="Web, Site" xmlns="http://schemas.microsoft.com/VisualStudio/2010/SharePointTools/SharePointProjectItemModel">
    <Files>
    <ProjectItemFile Source="Elements.xml" Type="ElementManifest" />
    <ProjectItemFile Source="App\app.js" Target="App\" Type="ElementFile" />
    <ProjectItemFile Source="App\somefolder\jquery.custom.js" Target="App\somefolder\" Type="ElementFile" />
    <ProjectItemFile Source="App\someotherfolder\common.js" Target="App\common\" Type="ElementFile" />
    </Files>
    </ProjectItem>
    view raw SharePointProjectItem1.spdata.xml hosted with ❤ by GitHub

    Looking at line 4, locate the Elements.xml file and validate that the referenced Elements.xml file contains all the files.
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <Module Name="RootModule">
    <File Path="App\app.js" Url="App/app.js" ReplaceContent="TRUE" />
    <File Path="App\somefolder\jquery.custom.js" Url="App/somefolder/jquery.custom.js" ReplaceContent="TRUE" />
    </Module>
    </Elements>
    view raw Elements.xml hosted with ❤ by GitHub

    If you look at this example, the Elements.xml file is missing common.js.
    <ProjectItemFile Source="App\someotherfolder\common.js" Target="App\common\" Type="ElementFile" />
    view raw SharePointProjectItem1.spdata.xml hosted with ❤ by GitHub

    SOLUTION: To add it back, you can add it manually, but since Visual Studio has a lot happening under the hood, this can lead to less than desirable results. First, make sure you are not in Debug Mode (Start will have a Green > if you are not in Debug Mode). Next, locate the file, right-click and select Exclude From Project. Then, right-click and select Include in Project. If you watch the Elements.xml file, you will see that your file has been added.
  3. You have files that are being deployed that do not have a proper Elements.xml file or is missing. Again, if you check all of your SharePointProjectItem.spdata files, you may find that a folder has been included and reference an Elements.xml in that particular folder.
    <?xml version="1.0" encoding="utf-8"?>
    <ProjectItem Type="Microsoft.VisualStudio.SharePoint.Module" DefaultFile="Elements.xml" SupportedTrustLevels="All" SupportedDeploymentScopes="Web, Site" xmlns="http://schemas.microsoft.com/VisualStudio/2010/SharePointTools/SharePointProjectItemModel">
    <Files>
    <ProjectItemFile Source="App\Elements.xml" Type="ElementManifest" />
    <ProjectItemFile Source="App\app.js" Target="App\" Type="ElementFile" />
    <ProjectItemFile Source="App\somefolder\jquery.custom.js" Target="App\somefolder\" Type="ElementFile" />
    <ProjectItemFile Source="App\someotherfolder\common.js" Target="App\common\" Type="ElementFile" />
    </Files>
    </ProjectItem>
    view raw SharePointProjectItem2.spdata.xml hosted with ❤ by GitHub

    SOLUTION: There are a few different ways to fix this, and you have another please let me know. However, in the past this has happened when I manually move files outside of the solution via the Explorer. To fix this, I added a new Empty Element Item and rebuilt the folder properly and deleting the offending folder.
  4. You have an Elements.xml file that contains a typo. This is most likely due to an accidental keystroke (e.g., extra character somewhere).
  5. You have an Elements.xml file that contains an unsupported node. One example of this is the Site Column Elements.xml. Please note that the Node/Tag names themselves and their values are case sensitive. For example:
    This is WRONG.
    <Field
    ID="{CD35883F-0814-4A9A-8FCD-9A7017E04742}"
    Name="CustomDateField"
    DisplayName="My Date Field"
    Type="DateTime"
    Format="DateOnly"
    Required="FALSE"
    Group="My Custom Group">
    <Choices>
    <Choice>Choice A</Choice>
    <Choice>Choice B</Choice>
    <Choice>Choice C</Choice>
    </Choices>
    <Mappings>
    <Mapping Value="1">Choice A</Mapping>
    <Mapping Value="2">Choice B</Mapping>
    <Mapping Value="3">Choice C</Mapping>
    </Mappings>
    <Default>Choice A</Default>
    </Field>
    view raw SiteColumns.Elements.xml hosted with ❤ by GitHub

    As much as you may be like me and think that the XML should be consistent (Capitalized first letter, lower case for the rest), it isn’t.

    This is CORRECT way.

    <Field
    ID="{CD35883F-0814-4A9A-8FCD-9A7017E04742}"
    Name="CustomDateField"
    DisplayName="My Date Field"
    Type="DateTime"
    Format="DateOnly"
    Required="FALSE"
    Group="My Custom Group">
    <CHOICES>
    <CHOICE>Choice A</CHOICE>
    <CHOICE>Choice B</CHOICE>
    <CHOICE>Choice C</CHOICE>
    </CHOICES>
    <MAPPINGS>
    <MAPPING Value="1">Choice A</MAPPING>
    <MAPPING Value="2">Choice B</MAPPING>
    <MAPPING Value="3">Choice C</MAPPING>
    </MAPPINGS>
    <Default>Choice A</Default>
    </Field>
    view raw SiteColumns.Elements.xml hosted with ❤ by GitHub
  6. You have an Elements.xml file that contains a node with a valid attribute and an invalid attribute value. One example of this is in the Site Column Elements.xml. In the Field node, the attribute Name‘s value cannot have spaces. For example, this will cause an error:
    <Field
    ID="{CD35883F-0814-4A9A-8FCD-9A7017E04742}"
    Name="CustomDateField"
    DisplayName="My Date Field"
    Type="DateTime"
    Format="DateOnly"
    Required="FALSE"
    view raw SiteColumns.Elements.xml hosted with ❤ by GitHub
  7. You may have a duplicate GUID somewhere.
    SOLUTION: Find all GUIDs by typing Ctrl + Shift + F and enter this Regex [a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{12} and under Find Options select the Use Regular Expressions. And then click Find All. In the Find Results, you will be able to compare the GUIDs.

Sometimes in the output, you will have the warning:

Unable to remove directory “pkg\Debug\”. The directory is not empty.

To fix this, you can go to Solution Explorer and click the Show All Files icon until you see the pkg folder. Expand the folder by clicking on the right arrow to the left of the folder. Then right click on the Debug folder and select Delete.

And for good measure, do the same with pkg folder. Expand the folder by clicking on the right arrow to the left of the folder. Then right click on the Debug folder and select Delete.

Finally, if any of the above do not work. Remove all items from the feature, adding them back one by one in a logical order Building/Starting in between each item. This will eventually tell you which item contains the culprit.

Please let me know if you found any that I did not include here.

Filed Under: Microsoft SharePoint, Development Tagged With: SharePoint Online, Visual Studio, Troubleshooting

April 1, 2015 by Travis Smith Leave a Comment

Microsoft Moves Forward!

Filed Under: Microsoft SharePoint, Videos

March 25, 2015 by Travis Smith Leave a Comment

Turning customerrors “off” in _layouts web.config for Debug Mode in SharePoint 2013

To set a web application to debug mode…

Open the

web.config

(C:inetpubwwwrootwssVirtualDirectories) and set:

  • Debug=”true” instead of the default of Debug=”false”
  • CallStack=”true” instead of the default of CallStack=”false”
  • CustomErrors=”Off” instead of the default of CustomErrors=”On”

I would have expected this to be enough to catch all errors but when I tried to delete a content type that was probably in use, instead of getting the detailed message I was expecting, I ended up getting the infamous message telling me to change the customerrors setting in the web.config so that I can see the details:

Server Error in ‘/’ Application.
Runtime Error

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed.
Details: To enable the details of this specific error message to be viewable on the local server machine, please create a tag within a “web.config” configuration file located in the root directory of the current web application. This tag should then have its “mode” attribute set to “RemoteOnly”. To enable the details to be viewable on remote machines, please set “mode” to “Off”.

As a refresher to anyone else that is running into this problem, there is another

web.config

in the

_layouts

directory (“C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions15”) where you need to turn the

customErrors

to be “Off”:

Filed Under: Microsoft SharePoint

  • « Previous Page
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • …
  • 10
  • Next Page »

Connect with Me

  • Github
  • Google+
  • Linkedin
  • Twitter

Recent Posts

  • Caching Problems with GraphQL at the Edge May 16, 2018
  • Resource Hinting with JavaScript September 29, 2017
  • How to Install Groovy September 28, 2017
  • You’ve Gotta Love Millennials by Micah Tyler April 10, 2017
  • Every Meeting Ever April 3, 2017
  • Home
  • About
  • CV
  • Resume
  • Privacy Policy
  • Contact

Copyright © 2021 · WP Smith on Genesis Framework · WordPress · Log in