When we are using App When , We will find some problems , For example, the website deployment 、 Update or uninstall , We are very concerned about our App Is someone using , This requires a remote event sink .

1、 In our tests App Select the mouse on your solution , Press F4 Pop up properties , Select the processing application we need , Choose True; meanwhile ,VS Will automatically create a solution , Let's write the relevant code of remote event receiver in it .

2、 In the solution of the remote event sink created , open svc Code for , And then add our code ( Attached ), Judge if the trigger is installation App Events , In a AppInstallLog Insert an installation record into the list of .

3、 The attached code , The code is simple , Increase permissions to write list Library , Not much ; After writing the code , Put this web The website is published to the server IIS Under the table of contents ;

if (properties.EventType == SPRemoteEventType.AppInstalled)
using (SPSite site = new SPSite("http://url:2014"))
using (SPWeb web = site.OpenWeb())
SPList list = web.Lists["AppInstallLogs"];
SPListItem item = list.Items.Add();
item[" title "] = "SP2013PictureWallApp";
item[" journal "] = "SP2013PictureWallApp On " + DateTime.Now.ToString() + " Has been installed !";

4、 stay App In the solution of , find AppManifest.xml file , Right click to see the code , modify InstalledEventEndpoint For our previously published site svc File directory ;

5、 We add our App, And then look at AppInstallLogs List Library , Found that an installation log has been written , This indicates that the development and deployment of remote event receiver is successful !


The above is about App During installation , The process of triggering events to be written to the installation log , Actually , The remote event sink can also do more work , Such as SharePoint Event triggers in the solution , by App Add events to a list or document library in , This requires us to create Remote Event Receiver The solution .

Special recommendation

The idea of the above content is from 《Microsoft SharePoint 2013 App Development》 A Book , I simply looked at the catalog , about App The introduction of development is very good , I recommend it to you !

SharePoint 2013 App Remote Event Receivers More articles about

  1. SharePoint 2013 APP Development example ( 3、 ... and ) Use remote web resources

    In this example, we'll describe in detail TokenHelper class , We're going to see how it's simply remotely web Site access SharePoint Of . And we're going to take some of its values . This will help us understand how connections are constructed , It's also convenient for us ...

  2. SharePoint 2013 APP Development example ( Two ) Get user information

    SharePoint 2013 APP Development example ( Two ) Get user information In this example , We'll show you how to get user information : 1. open Visual Studio 2012. 2. Create a new   SharePo ...

  3. SharePoint 2013 APP Development example ( 6、 ... and ) Server cross domain access Web Service (REST API)

    Last example (SharePoint 2013 APP Development example ( 5、 ... and ) Cross domain access Web Service (REST API)) Is based on JavaScript, Running on the web browser I'm going to visit REST AP ...

  4. SharePoint 2013 APP Development example ( 5、 ... and ) Cross domain access Web Service (REST API)

          although JQuery It can also be authorized header Achieve cross-domain , but SharePoint Provides a simpler way , It's implemented in SP.RequestExecutor in . It can access cross domain services, including REST AP ...

  5. SharePoint 2013 APP Development example series

    SharePoint 2013 APP Security : SharePoint 2013 APP Development example ( One )List Reading and writing SharePoint 2013 APP Development example ( Two ) Get user information Share ...

  6. SharePoint 2013 APP Development example ( Four )JQuery visit REST

    In this example , We will use JQuery AJAX Send a REST request , And see the returned results . In order for us to better understand REST Interface , We'll add an input box that allows the user to specify REST Of URL, This will allow us to try to construct with U ...

  7. SharePoint 2013 APP Development example ( One )List Reading and writing

    In this example , We're going to create a page test SharePoint APP Authority . This page has two buttons , A from documents Read in the data , A to documents Write the data : 1. open Visual Studio ...

  8. SharePoint 2013 App The picture wall of the example

    Applications are essentially Web Applications . If you know how to generate Web Applications , Then you know how to generate SharePoint Related applications . You can use any language , Such as HTML.JavaScript.PHP or . ...

  9. BEGINNING SHAREPOINT® 2013 DEVELOPMENT The first 2 chapter --SharePoint 2013 App Model overview Understand three SharePoint Deployment model Apps

    BEGINNING SHAREPOINT 2013 DEVELOPMENT The first 2 chapter --SharePoint 2013 App Model overview Understand three SharePoint Deployment model Apps       ...

Random recommendation

  1. python Basic knowledge of ( Four )

    Abstract : Mainly involves lambda expression .python Built in functions (open The focus of the document ). Bubble sort One .lambda expression For creating simple functions , Also called anonymous function , Function name = lambda Parameters : Return value funct ...

  2. ssl Summary

    There are some good articles : http://www.cnblogs.com/pen-ink/archive/2011/01/17/1937680.html  This should be the simplest example . however , When two passwor ...

  3. scrapy Introduction to crawler framework

    scrapy Please refer to : Installation guide . We're going to use the Open Directory Project (dmoz) As an example of grabbing . This introductory tutorial will guide you through the following tasks : Create a new Scrapy project Define extracted Item Write a Spider For crawling ...

  4. POJ 2200 A Card Trick( simulation )

    Topic link The question : altogether 52 card (A, 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K) The colors are C,D,H,S ... For the assistant 5 card , Then the assistant needs to rearrange the order , Give me the first card ...

  5. iOS Development —— Baidu cloud push

    Because the company project is an integrated Aurora push , See the next blog . Integrated Baidu push is about the same , It's best to refer to the official document integration , Official documents or official website tutorials are the best blogs . Baidu Push service SDK User's Manual (iOS edition ) http://push. ...

  6. Trafic

    Dialogue 1  You took the wrong bus You're on the wrong bus A:Hi, I want to see the Terra Cotta Warriors in Xi'an. Coul ...

  7. SET ANSI_NULLS (Transact-SQL)

    Specified in the SQL Server 2014 China and Null Value is equal to (=) And are not equal to (<>) The comparison operator uses the ISO Standard behavior . When SET ANSI_NULLS by ON ...

  8. LeetCode OJ 95. Unique Binary Search Trees II

    Given n, generate all structurally unique BST's (binary search trees) that store values 1...n. For e ...

  9. grafana Backup

    #!/bin/bash # Automatic backup grafana Database and upload to cloud disk NOWDATE=`date +%Y-%m-%d` YUNPAN_USER=xxxx YUNPAN_PASSWD=XXXXXXXXXX ...

  10. VS2013 VS2015 VS2017 Debugging failed to start iis express web The server

    I've come across this problem all the time recently , Every day , be overburdened , There are many online answers , But none of them can solve , It's also caused by different environments , Here are a few solutions One . Other projects can , Just one can't Because other projects can , Just one can't , the ...