When trying to do an F5-Deploy of a Provider hosted app from Visual Studio, I got this error during the deployment:
Error occurred in deployment step ‘Uninstall app for SharePoint’: Your app handles the uninstalling app event. Ensure that the Windows Azure Cloud Web Service project is deployed to the emulator prior to uninstalling the app.
This happened just after the step “Uninstall app for SharePoint” in the process.
Googling the error didn’t find a lot of results – in fact, there is only this thread. It recommends:
As a workaround, please try setting your app’s “Handle App Uninstalling” property to “False” before you F5, and then from the app project’s context menu, run the “Retract…” command. This should unblock the retraction of the app during F5, after which you can re-enable handling of the uninstalling events.
Well… I tried that. Turning off the handling of the App Uninstalling event did make the F5 deploy work – but my Uninstalling event was never run (as one would expect). I did run the Retract command, but when I re-enabled the handling of the uninstalling event the problem recurred.
If I enabled the Uninstalling event and did a proper deploy – not an F5 one – then the uninstalling event actually worked nicely. By some miracle my code had no faults, and did exactly what it was supposed to do (remove a Remote Event Receiver definition).
Thus, for now, I’ll just add this to the list of changes that need to be performed between debug and release. I’m not sure how one can debug the uninstalling event, though.
3 thoughts on “App Deployment Error: "Your app handles the uninstalling app event"”
Same issue, If you was lucky and found a solution please let me know.
I didn’t find one, I just had to disable this when trying to do a Debug deployment.
Hey Andy… Do you know if there are any improvements to this process? I have wasted so much time messing around with remote event receivers, it is just bizarre. I’m simply trying to, for an example, set the title of a list item when I add an item to the list. I have come from developing event receivers in SharePoint 2010 (on premises mostly). This debugging process is full of traps and makes it so complex to do something so simple. I actually wrote one of these back about 2 years ago and it is running in production today without issue.
I find it amazing that Microsoft hasn’t developed some way to better enable developers to do this type of work… Works fine in the app web, screwed on the host web!
I’m considering saying screw it and using SharePoint Workflows to do all this work… At least those seem relatively reasonable to debug and write. I could also use a regular Web Service to call from the workflow rather than this bull#$%$…
There must be an easier way to do this!