Forum Discussion

BenoitC01's avatar
BenoitC01
Copper Contributor
Sep 04, 2024

Response from EventReceiver in SP 2019

Hello everyone,
I'm having a problem with an EventReceiver in SharePoint OnPremise 2019.
This Event Receiver, developed in Visual Studio, launches when a file is added to a document library.
There are 3 events:
ItemAdding
ItemAdded
ItemUpdated
In the ItemAdding event, we check that the file uploaded is a ZIP file, that the person has the right to uninstall a file, and so on.
And we return a custom error message via ctx.OutgoingResponse.

We add a file to this library from a Front application in React, using the SharePoint APIs:

The events are executed correctly when a file is added.
On my development and internal acceptance environments, it works correctly, and error messages are retrieved from the front by the code:

 

But on the customer's test and production environments, the message is not retrieved, I always get an empty message.

ctx.OutgoingResponse.StatusDescription = ex.Message; 

What could be causing this difference in response?
I've compared the web.config files and can't find anything.
Parametrisation at the IIS server level?

Thanks for your help

No RepliesBe the first to reply

Resources