Domanda

There are many articles about how to develop and debug remote event receivers, and after reading many, I have developed my RER, azure website, azure service bus and they are all working well together and my breakpoints are being hit. So far so great.

The problem is that when I stop my debugger, although the app is still installed, and the azure website is still there, the event receiver won't fire. One day I would like to leave this baby in the wild without holding its hand! I have tried unchecking the "Enable debugging via MS Azure Service bus" in the project properties and reinstalled the app, but that will not fire the event receiver either attached or not attached.

Has anyone experienced this?

È stato utile?

Soluzione

Turns out that the path to debugging a RER is unconventionally different than publishing without debugging. That means when you are debugging you have to follow some steps, but when you want to publish (and detach) you have to undo these steps and take some other steps.

  1. As mentioned in the question the first undo step is to remove "Enable debugging via MS Azure Service bus" from project properties.
  2. You can delete/remove your Azure Service Bus for debugging. Not required anymore.
  3. Create a client ID/Secret for the app. Depending on if you want to publish to AppSource or use locally, there are different methods to do this that you can find in the link.
  4. Add the client ID/Secret to the appsettings in the web.config of your add-in web app.
  5. add only the ClientID to your AppManifest.xml of your add-in.
  6. Not sure about this step, but you may need to add the ClientID and ClientSecret to your azure web app Application Settings. Build a SharePoint Provider Hosted App in 5 minutes might be useful.
  7. Right click on the add-in project and choose Publish. There is "Edit" button next to Current profile. Click there and update Client Secret/ID here as well.
  8. Deploy add-in by F5 and do something to run RER. Breakpoints won't be hit, but if everything is okay you should see the results of them run.

Note steps 6 and 7 might not really be required. They are there just to make sure.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top