1

I am developing a remote event receiver for our site collection. so inside Visual Studio 2015, i did the following:-

  1. i created a new sharepoint add-in of type provider hosted app. I added the code as per this link https://blogs.msdn.microsoft.com/kaevans/2014/02/26/attaching-remote-event-receivers-to-lists-in-the-host-web/.

For the debugging site collection i chose a test enterprise wiki online site collection which I have enabled its Sideloading of apps feature.

  1. inside Azure i created a new service bus, as follow >> i copied the primary connection string:- enter image description here

  2. inside the visual studio project >> Properties >> SharePoint >> i added the above service bus's primary connection string, as follow:- enter image description here

  3. i run the project >> where i got this message >> i select the list >> click on "Trust":- enter image description here

  4. i got the app home page as follow:- enter image description here

  5. i got the app added correctly inside my site content:- enter image description here

but the visual studio stop running and showed these 2 messages:- enter image description here

One or more services were unregistered from the Microsoft Azure Service Bus. Cannot register Services/AppEventReceiver.svc on Microsoft Azure Service Bus: Unable to connect to the remote server

so i am not sure what is going on ? why the service bus is not working, and as a result we are not able to debug our remote event receiver?

here is my AppManifest.xml:-

<?xml version="1.0" encoding="utf-8" ?>
<!--Created:cb85b80c-f585-40ff-8bfc-12ff4d0e34a9-->
<App xmlns="http://schemas.microsoft.com/sharepoint/2012/app/manifest"
     Name="CustomerServiceKB"
     ProductID="{28e4281a-1114-4d41-82dd-6277e01c7d34}"
     Version="1.0.0.0"
     SharePointMinVersion="16.0.0.0"
>
  <Properties>
    <Title>CustomerServiceKB</Title>
    <StartPage>~remoteAppUrl/?{StandardTokens}</StartPage>
    <InstalledEventEndpoint>~remoteAppUrl/Services/AppEventReceiver.svc</InstalledEventEndpoint>
    <UninstallingEventEndpoint>~remoteAppUrl/Services/AppEventReceiver.svc</UninstallingEventEndpoint>
  </Properties>

  <AppPrincipal>
    <RemoteWebApplication ClientId="*" />
  </AppPrincipal>
  <AppPermissionRequests AllowAppOnlyPolicy="true">
    <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web/list" Right="Manage" >
       <Property Name="BaseTemplateId" Value="100" />
    </AppPermissionRequest>
  </AppPermissionRequests>
</App>

2 Answers 2

1

Right-click on your SharePoint App project in Visual Studio and select “SharePoint“. There you can uncheck “Enable Remote Event Debugging“. It no longer works with debugging provided hosted app. Instead attach a cloud debugger to the azure web app to debug.

enter image description here

6
  • ok thanks for the reply. but you mentioned ` Instead attach a cloud debugger to the azure web app to debug.` ...But in my case i am still developing the project inside visual studio,, so still i did not deploy it inside azure.. so is there a similar/exact replacement to what the azure service bus use to do, in enabling us to debug the RER (Provider-Hosted app) inside visual studio?
    – John John
    Commented Mar 31, 2019 at 15:41
  • 1
    You can use ngrok instead google.com/amp/s/derekgusoff.wordpress.com/2017/11/08/… Commented Mar 31, 2019 at 19:04
  • thanks i already read this link before,, but it uses different appraoch for creating RER.. now i am following the steps mentioned here blogs.msdn.microsoft.com/kaevans/2014/02/26/… so can i use ngrok instead of azure service bus in my case?
    – John John
    Commented Mar 31, 2019 at 22:44
  • Yes try ngrok instead Commented Apr 2, 2019 at 8:27
  • i ried it, but when i type the generated url such as http://ebec8431.ngrok.io/Services/AppEventReceiver.svc while the visual studio is running, i got 502 Bad Gateway
    – John John
    Commented Apr 2, 2019 at 9:22
1

I've founded a little trick. We should launch VS as an administrator. This simple action solved the same issue as described in the topic.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.