Farm Solution Deployment Problems – “Could not load file or assembly…”

When building my most recent project, I had no issues deploying my solution from Visual Studio directly to the farm, however once the solution was packaged and deployed via PowerShell, I started running into errors…

SharePoint : Failed to load receiver assembly "Nauplius.ADLDS.FBA, Version=1.0.0.0, Culture=neutral, PublicKeyToken=262c1486943f3872" for feature "FBA_STSHealthAnalyzer" (ID: d67ce2c7-8d09-4581-b0c4-3e1ce008911f).: System.IO.FileNotFoundException: Could not load file or assembly 'Nauplius.ADLDS.FBA, Version=1.0.0.0, Culture=neutral, PublicKeyToken=262c1486943f3872' or one of its dependencies. The system cannot find the file specified.

In the past, this has indicated the death of the project.  No amount of Timer Service restarts, iisresets, Process Explorer handle searches, or making sure the assembly\GAC_MSIL and assembly\temp folders are free of the binary would fix this.  Moving to a new project will usually resolve this, however that is a lot of work!

Instead, simply changing out the project’s strong key assembly worked in this particular case.  If you haven’t had to change this before, it is under the properties of the project -> Signing.  Under ‘Choose a strong name key file’, select New.  The password is optional.

After changing the strong name key file, the PublicKeyToken for the assembly will be updated.

10 Comments

  1. thanks, change the signing worked. I used like 4 hours today trying out different methods suggested on stackoverflow

  2. Thanks! Very helpful!

  3. This worked for me. Thanks! Saved me a huge headache

  4. You, my dear sir, deserve many beerz for this. Wasted most of my day before finding your post.

  5. Hi Trevor,
    Thanks a lot for this post, you save my day. I was trying to resolve this from few hours with a production project that stop working after I edit the Feature manifest and choose the “Discard manifest edits and re-enable the designer link”.
    I create a new snk file and browse to choose that in the signing section and it starts working with some other error that I fix later.

    Thanks a lot DUDE.

    Regards,
    Suparna

  6. Thanks! This is the 3rd time in two weeks that this error comes up.

  7. I rarely post ‘thank-you’s but this time I made an exception. I forgot that I had renamed my .snk file, which ended up causing the error that you describe. Generating a new snk did the trick. Thanks!

  8. Thanks a lot! This article helped me out (with SP2010 solution, though).

  9. Thank you so much! Easy fix for annoying problem :)

  10. Changing the key worked. Thanks!

Leave a Reply