Should the SharePoint EventReceiver component be installed in the GAC, and if so, do you still need to have all the dependent assemblies?

My company ships a product that, among other things, registers SharePoint EventReceiver with SPLists, tracks changes. I register it with the GAC, where it works fine. However, one of our customers expressed dissatisfaction with our build installed in the GAC and wishes us to move our binaries to the SharePoint BIN directory and perform another security / trust voodoo that is required for this scenario to work.

When I try to register an event receiver that is not in the GAC, I get a very specific exception, whose message reads: "The event receiver collection is not in the GAC." I interpret this as SharePoint, requiring event receivers to be installed in the GAC. In addition, I found this on MSDN: http://msdn.microsoft.com/en-us/library/ff407965.aspx : the section "Event Events and Processing Events" contains

SharePoint Foundation event handlers are a compiled custom managed code module that is invoked by the specified event that you specified. The event handler code is compiled into a .dll file and deployed to the GAC.

This again implies, but does not exhaust, that installing the GAC is a requirement. Does anyone know the answer to this for sure, so I can go back to the client and explain our GAC requirement?

The next question: if I have an assembly in the GAC and I “statically link” with other assemblies, that is, I do not explicitly dynamically load them using Assembly.Load () - then should these other assemblies also reside in the PAC?

+5
source share
2 answers

Event listener collections cannot only be installed in "bin" because in this way the .net infrastructure could not find them.

"bin" , , . GAC, "bin" .

, , - - codebehind ASPX, - .., inetpub..../bin, -.

" " OWSTIMER.exe, Windows. Windows, - c:\windows.

, - inetpub...\bin, owstimer.

, , , GAC.

+11

SharePoint EventReceiver Bin. GAC. , , , - .

0

All Articles