SharePoint 2019 On Premise Event Receiver

SHUO .H 706 Reputation points
2021-01-25T14:46:50.013+00:00

Hi there,

There are two Servers in SharePoint Farm. One is Application, another is Front-End. We have a custom Event Receiver will be installed in the Custom List. I found out something wired. The first time, we install the Event Receiver by PowerShell command as follows:

  1. Add-SPSolution c:\code\SharePointProject2\bin\debug\SharePointProject2.wsp
  2. Install-SPSolution -Identity SharePointProject2.wsp - Force -GACDeployment

Everything works well. Second time, we have a update. so we use Update-SPSolution to update our Event Receiver. No any error show up. Actually, It didn't be updated. So we restart, clear SharePoint cache. --> Cannot work well.

Finally, we retracted the solution from CA and remove it. We install the Event Receiver once again by PowerShell command.

  1. Add-SPSolution c:\code\SharePointProject2\bin\debug\SharePointProject2.wsp
  2. Install-SPSolution -Identity SharePointProject2.wsp - Force -GACDeployment

After step 2, still cannot update our Event Receiver to new version. We change the command to Install-SPSolution -Identity SharePointProject2.wsp -Local - Force -GACDeployment and use this command to execute on two machines separately. We successfully updated to the latest version and worked well.

But when I used the following command to check the Event Receiver status in custom list:

  1. $Web = Get-SPWeb "http://xxx.xxx.xxx"
  2. $List = $Web.Lists["xxxxxxxx"]
  3. $List.EventReceivers | Select Id, Type, Assembly, Class | FL

PowerShell cannot find out any Event Receiver was installed in this List (Even I use any tools to check the Event Receiver in this list.). but It really can be executed in the custom list. Does anyone run into this situation before.

Thanks

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,376 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,619 questions
{count} votes

Accepted answer
  1. Jerryzy 10,571 Reputation points
    2021-01-26T07:31:18.447+00:00

    Hi @SHUO .H ,

    I tested with Add/Install-SPSolution and it's working to get Event details with PowerShell:

    60562-snipaste-2021-01-26-15-27-30.png

    60408-snipaste-2021-01-26-15-06-45.png

    For the issue, I suggest you can create a new custom list and get with PowerShell to see if the event can be return, if the issue still exists, try to do IIS Reset:

    IIS-Reset

    Thanks
    Best Regards


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.