I have a Provider-Hosted SharePoint app with an appmanifest.xml
that looks something like this:
<Properties>
<Title>My app title</Title>
<StartPage>
~remoteAppUrl/home/index?{StandardTokens}
</StartPage>
<InstalledEventEndpoint>
~remoteAppUrl/Services/AppEventReceiver.svc
</InstalledEventEndpoint>
<UpgradedEventEndpoint>
~remoteAppUrl/Services/AppEventReceiver.svc
</UpgradedEventEndpoint>
<UninstallingEventEndpoint>
~remoteAppUrl/Services/AppEventReceiver.svc
</UninstallingEventEndpoint>
</Properties>
I am publishing the app by adding it to the app catalog and then adding it to a site, I am not side-loading it from Visual Studio. When the app is installed or upgraded, the ProcessEvent
method from the AppEventReceiver
class is invoked.
However, when the app is removed from the site, the ProcessEvent
method from the AppEventReceiver
class is NOT invoked. I have tried something like this:
public class AppEventReceiver : IRemoteEventService
{
public SPRemoteEventResult ProcessEvent(SPRemoteEventProperties properties)
{
var result = new SPRemoteEventResult();
switch (properties.EventType)
{
case SPRemoteEventType.AppUpgraded:
case SPRemoteEventType.AppInstalled:
Trace.WriteLine("App is being installed or upgraded...");
break;
case SPRemoteEventType.AppUninstalling:
Trace.WriteLine("App is being uninstalled...");
break;
}
return result;
}
}
The app is published to an azure website. When I turn on Verbose logging and watch the log streams, I can see:
Application: 2014-12-09T13:11:35 PID[1972] Verbose App is being installed or upgraded...
However when removing the app, I never see any log messages. Also, I can attach a remote debugger and step through the code when the app is installed or upgraded. When removing the app, my breakpoints are never hit.
What gives?