3

I have an office 365 farm + visual studio 2015 professional. now i want to create a new remote event receiver, so i did the following steps:-

  1. I create a new project of type "SharePoint Add-in":-

enter image description here

  1. then i chose the type as sharepoint-hosted app:-

enter image description here

  1. and the environment as SharePoint online:- enter image description here

  2. then i added a remote event receiver:-

enter image description here

but i got this error:-

Could not load file or assembly 'Microsoft.SharePoint.Client.Runtime, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.            0   

as follow:-

enter image description here

i access the following location inside my dev machine:-

C:\Windows\Microsoft.NET\assembly\GAC_MSIL\

and i find the Microsoft.Office.SharePoint.Tools exists, as follow:-

enter image description here so the question is why the VS project can not load this ? so can anyone advice what is going on ? side note. the error which i am getting is referring to a file with version = 15.0.0.0, while i am developing add-in for office 365 so the version should be 16 instead of 15 ? is this correct? and can this reveal the problem i am facing?

  • 1
    Have you run Install-Package Microsoft.SharePointOnline.CSOM from Nuget? – Trevor Seward Jan 4 '18 at 3:21
  • 1
    @TrevorSeward thanks for the reply.. now i install the package, then i close/reopen visual studio, after that i tried to add a new remote ER but i got the exact error.. – john Gu Jan 4 '18 at 9:46
  • 1
    @TrevorSeward can you please advice on my above comment ? – john Gu Jan 5 '18 at 14:11
  • Can you try with provider hosted app ? SharePoint hosted apps don't support remote event receivers ? Also ensure that the SharePoint online url is valid – Gautam Sheth Jan 6 '18 at 4:36
  • And you have .Net framework >= 4.5 rite? – little_big_thoughts Jan 6 '18 at 6:38
2
+100

Couple of things you can look into:

1) Ensure that you are using the VS 2015 Update 3 (preferred). ( Open VS and check Help > About Microsoft Visual Studio)

2) Also, it looks like some issue(most probably) with Office Developer tools. So, you can download and install the latest using Web Platform Installer(WPI) 5.0 and search for Office tools as below:

enter image description here

Download link for WPI - Web Platform Installer

Once WPI is installed, install the office tool mentioned in above pic and then restart Visual studio and then check.

Also, you can uninstall and reinstall the SPO Client components SDK and then check again.

Download for SDK - SPO Client components SDK or download via Nuget as suggested by Trevor Seward.

Yes, the version should be 16.0.x.x.

Also, RERs are supported only in Provider hosted app(PHA) not in SharePoint hosted app. So, you should create a PHA and add the RER to the SharePoint project.

Update - SharePoint works in mysterious ways.

Turns out, to do SharePoint online app development, we need to also install SharePoint Server 2013 Client Components SDK as well besides SharePoint online client components SDK. There seems to be a dependency of online component on the 2013 SDK.

Once installed, this error will disappear.

Restart visual studio and then create a new project to test out.

Download link - SharePoint Server 2013 Client components SDK

  • thanks for your detailed reply. now let me start from the beginning to describe my current situation. i have VS 2015 professional version 14.0.25 update 3. i also have WPI installed and inside it, it mentioned that the "Microsoft Office Developer tools update 2 for VS 2015 " is already installed... so what should i do now ? shold i uninstall SPO cleint components and re-install them ? – john Gu Jan 8 '18 at 16:03
  • yes that might help. Also, can you check if the Microsoft.SharePoint.Client dlls are present at C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI location ? – Gautam Sheth Jan 8 '18 at 16:12
  • now inside the control panel i can not find SPO Client components SDK .. i can only see a program named "sharepoint client components" and not "sharepoint online client components".. for the location C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI yes the Microsoft.SharePoint.Client is already there... – john Gu Jan 8 '18 at 16:21
  • so what do u think ? now i already run this commadn Install-Package Microsoft.SharePointOnline.CSOM inside my project but it did not fix the problem.. – john Gu Jan 8 '18 at 16:21
  • @Guatam now i try downloading the sdk from microsoft.com/en-in/download/details.aspx?id=42038 but when i try to install the sharepointclientcomponents_16-6906-1200_x64-en-us.msi i got an error that another version of this product is already installed !! – john Gu Jan 8 '18 at 16:26
0

Please check if SharePoint Client SDK componment has been installed in your local PC, because remote event receiver needs SharePoint CSOM supported, you can download and install from below:

SharePoint Online Client Components SDK

  • so which version i need to install 16-6518-1200 or 16-6906-1200 ?? – john Gu Jan 4 '18 at 9:43
  • 16-6906-1200 in above link, sdk will register to GAC, it should fix this error – Jerry_MSFT Jan 4 '18 at 11:14
  • i got an error that another version of this product is already installed... – john Gu Jan 4 '18 at 11:23
  • 1
    @TrevorSeward thanks for the reply.. now i install the package from Nuget, then i close/reopen visual studio, after that i tried to add a new remote ER but i got the exact error.. – john Gu Jan 4 '18 at 16:50
  • 1
    @Jerry_SPWX can you please advice on my above comments please? – john Gu Jan 5 '18 at 14:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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