locked
Unable to deploy list item event receiver RRS feed

  • Question

  • Hi,

    I have problem with deployment of list item event receivers - it fails at "Activating Features" step.

    The weird thing is that, if I create another empty solution and just copy all the code - that solution

    can be deployed - but only temporarily since it stops working after some time, with the same error.

    This is the stack trace of the error:

    Error occurred in deployment step 'Activate Features': Failed to load receiver assembly "VPNEventReceivers, Version=1.0.0.1, Culture=neutral, PublicKeyToken=2e2aea4f26d8acdf" for

    feature "VPNEventReceivers_Feature1" (ID: 2c60309c-1030-47b3-8861-85a662e4279a).: System.IO.FileNotFoundException: Could not load file or assembly 'VPNEventReceivers, Version=1.0.0.1,

    Culture=neutral, PublicKeyToken=2e2aea4f26d8acdf' or one of its dependencies. The system cannot find the file specified.

    File name: 'VPNEventReceivers, Version=1.0.0.1, Culture=neutral, PublicKeyToken=2e2aea4f26d8acdf'

       at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder,

    Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

       at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder,

    Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

       at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)

       at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)

       at System.Reflection.Assembly.Load(String assemblyString)

       at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()

      

    I have tried 2 ways to create list item event receivers:

    1. using visual studio: add new item, event receiver ... using GUI

    2. programmatically in feature activated event

    The result is the same. My solution contains only two list item event receivers (for two different SharePoint lists).

    I'm trying to deploy this feature using Visual Studio 2012.

    Can you please help me with this?

    Tuesday, October 8, 2013 3:15 PM

Answers

  • Hi,

    Recreating assembly signing key usually solves this problem. No other ways has ever worked for me. But this, most likely, won't be your only problem. There is part of feature that's already registered and so you'll need either use -force to install your solution or use some custom code to clear solution features from your site.

    • Marked as answer by Dennis Guo Thursday, October 17, 2013 3:04 PM
    Tuesday, October 8, 2013 3:20 PM
  • Hello,

    Please try to manually deploy your solution, I mean not using VS 2012 to see if this makes any changes in result. Also verify if your dll is still there when your feature gets activated.

    If above suggestions does not solves your problem, please post your code(Feature and Event) so that I can take a look. Also explain the purpose of event reciever a little bit.

    Thanks


    Thanks, Rakesh
    Please Mark As Answer if my post solves your problem or Vote As Helpful if a post has been helpful for you. ***Posting is provided "AS IS" with no warranties, and confers no rights.

    • Marked as answer by Dennis Guo Thursday, October 17, 2013 3:04 PM
    Tuesday, October 8, 2013 4:11 PM

All replies

  • Hi,

    Recreating assembly signing key usually solves this problem. No other ways has ever worked for me. But this, most likely, won't be your only problem. There is part of feature that's already registered and so you'll need either use -force to install your solution or use some custom code to clear solution features from your site.

    • Marked as answer by Dennis Guo Thursday, October 17, 2013 3:04 PM
    Tuesday, October 8, 2013 3:20 PM
  • Hello,

    Please try to manually deploy your solution, I mean not using VS 2012 to see if this makes any changes in result. Also verify if your dll is still there when your feature gets activated.

    If above suggestions does not solves your problem, please post your code(Feature and Event) so that I can take a look. Also explain the purpose of event reciever a little bit.

    Thanks


    Thanks, Rakesh
    Please Mark As Answer if my post solves your problem or Vote As Helpful if a post has been helpful for you. ***Posting is provided "AS IS" with no warranties, and confers no rights.

    • Marked as answer by Dennis Guo Thursday, October 17, 2013 3:04 PM
    Tuesday, October 8, 2013 4:11 PM