Sandbox, does FeatureReceiver work in Office365?
-
12-12-2020 - |
Вопрос
Sandbox with code are disabled in SharePoint Online. Does it mean that I cannot use Feature Receivers?
I have a sandbox solution with reciever, it works ok but if I check "Include assembly in package" to false
I get deployment error:
Error occurred in deployment step 'Activate Features': Unable to load assembly group. The user assembly group provider was unable to provide any user assemblies for the specified assembly group.
Does it mean that if I want to use "Office365-friendly" solution - I can't use feature receivers?
upd.: Created Module and wanted to clear my files in FeatureDeactivating event in Feature receiver. Thanks for Your answers, understand that it is impossible.
However, I found how to force overwrite my files in module without clearing with code:
<File Path="SomeFolder\jquery-3.1.1.min.js" Url="SomeFolder/jquery-3.1.1.min.js" Type="GhostableInLibrary" ReplaceContent="TRUE"/>
Решение
Unfortunately yes, you can't use feature receivers.
To recap here is what is no longer available for Online:
- Event
- Feature receivers
- Workflows (coded)
- InfoPath forms (if using code behind the forms)
- Web parts (if coded using sandbox code)
The only option is to use remote event receivers and new add-in model.
Check out also this excelent writing around custom code deprecation for sandbox - Sandbox code no longer available in Office 365
More info about remote event receivers - Create a remote event receiver in SharePoint Add-ins and Handle events in SharePoint Add-ins
Другие советы
it is gone from Office 365 and you have to use new app model/add-in to create your stuff.
this is official statement.
While developing sandboxed solutions that contain only declarative markup and JavaScript — which we call no-code sandboxed solutions (NCSS) — is still viable, we have deprecated the use of custom managed code within the sandboxed solution.