I was deploying a SharePoint App-Model app in my development environment. It went into the catalog just fine, but it failed when trying to add it to a SharePoint site. It uses a remote web and has application install event receivers. The helpful error message that came back just said that the event receivers failed to return a successful response. There was also a correlation ID that I used to track down the following exception in the ULS:
e6059cf2-70ba-4799-a656-4eb6ec3fbc5c Stack trace:
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
Super helpful. Since this is a development environment I’m running in high-trust mode, which means that we have a certificate that drives the authentication mechanism apps use to talk to SharePoint. When I reviewed the remote web’s web.config, it turns out that that it was configured to use the wrong certificate. After changing to the correct one, the error went away. Unfortunately, the error message does absolutely nothing to point you in the right direction. I presume that the same error will occur if your certificate password or issuer ID are invalid too, so you may have a couple of configuration settings to look at if you run into this error message.